|
|
Log in / Subscribe / Register

coredump: cleanups & pidfd extension

From:  Christian Brauner <brauner-AT-kernel.org>
To:  linux-fsdevel-AT-vger.kernel.org
Subject:  [PATCH 00/22] coredump: cleanups & pidfd extension
Date:  Tue, 28 Oct 2025 09:45:45 +0100
Message-ID:  <20251028-work-coredump-signal-v1-0-ca449b7b7aa0@kernel.org>
Cc:  Oleg Nesterov <oleg-AT-redhat.com>, Amir Goldstein <amir73il-AT-gmail.com>, Aleksa Sarai <cyphar-AT-cyphar.com>, Yu Watanabe <watanabe.yu+github-AT-gmail.com>, Josef Bacik <josef-AT-toxicpanda.com>, Jeff Layton <jlayton-AT-kernel.org>, Jann Horn <jannh-AT-google.com>, Luca Boccassi <luca.boccassi-AT-gmail.com>, Alexander Mikhalitsyn <alexander-AT-mihalicyn.com>, linux-kernel-AT-vger.kernel.org, Alexander Viro <viro-AT-zeniv.linux.org.uk>, Jan Kara <jack-AT-suse.cz>, Lennart Poettering <lennart-AT-poettering.net>, Mike Yuan <me-AT-yhndnzj.com>, Zbigniew JÄ™drzejewski-Szmek <zbyszek-AT-in.waw.pl>, Christian Brauner <brauner-AT-kernel.org>
Archive-link:  Article

Hey,

The recent changes to rework coredump handling to rely on unix sockets
are in the process of being used in systemd. Yu reported on shortcoming
nameling that the signal causing the coredump was available before the
crashing process was reaped.

The previous systemd coredump container interface requires the coredump
file descriptor, and basic information including the signal number to be
sent to the container. This means we need to have the signal number
available before sending the coredump to the container.

In general, the extension makes sense and fits with the rest of the
coredump information.

In addition to this extension this fixes a bunch of the tests that were
failing and reworks the publication mechanism for exit and coredump info
retrievable via the pidfd ioctl.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
Christian Brauner (22):
      pidfs: use guard() for task_lock
      pidfs: fix PIDFD_INFO_COREDUMP handling
      pidfs: add missing PIDFD_INFO_SIZE_VER1
      pidfs: add missing BUILD_BUG_ON() assert on struct pidfd_info
      pidfd: add a new supported_mask field
      pidfs: prepare to drop exit_info pointer
      pidfs: drop struct pidfs_exit_info
      pidfs: expose coredump signal
      selftests/pidfd: update pidfd header
      selftests/pidfd: add first supported_mask test
      selftests/pidfd: add second supported_mask test
      selftests/coredump: split out common helpers
      selftests/coredump: split out coredump socket tests
      selftests/coredump: fix userspace client detection
      selftests/coredump: fix userspace coredump client detection
      selftests/coredump: handle edge-triggered epoll correctly
      selftests/coredump: add debug logging to test helpers
      selftests/coredump: add debug logging to coredump socket tests
      selftests/coredump: add debug logging to coredump socket protocol tests
      selftests/coredump: ignore ENOSPC errors
      selftests/coredump: add first PIDFD_INFO_COREDUMP_SIGNAL test
      selftests/coredump: add second PIDFD_INFO_COREDUMP_SIGNAL test

 fs/pidfs.c                                         |   89 +-
 include/uapi/linux/pidfd.h                         |   11 +-
 tools/testing/selftests/coredump/.gitignore        |    4 +
 tools/testing/selftests/coredump/Makefile          |    8 +-
 .../coredump/coredump_socket_protocol_test.c       | 1568 ++++++++++++++++++
 .../selftests/coredump/coredump_socket_test.c      |  742 +++++++++
 tools/testing/selftests/coredump/coredump_test.h   |   59 +
 .../selftests/coredump/coredump_test_helpers.c     |  383 +++++
 tools/testing/selftests/coredump/stackdump_test.c  | 1662 +-------------------
 tools/testing/selftests/pidfd/pidfd.h              |   15 +-
 tools/testing/selftests/pidfd/pidfd_info_test.c    |   73 +
 11 files changed, 2914 insertions(+), 1700 deletions(-)
---
base-commit: a779e27f24aeb679969ddd1fdd7f636e22ddbc1e
change-id: 20251026-work-coredump-signal-a72203cdf6eb




Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds