[PATCH] uapi/pidfd: correct the coredump signal and code comments

From: Nikolai Dokutovich

Date: Sat Nov 28 2026 - 20:41:28 EST


PIDFD_INFO_COREDUMP_SIGNAL and PIDFD_INFO_COREDUMP_CODE are documented
as "always returned if PIDFD_INFO_COREDUMP is requested", but pidfs
only raises them when a coredump has actually been recorded for the
task. Requesting PIDFD_INFO_COREDUMP for a live task returns
PIDFD_INFO_COREDUMP and coredump_mask without the signal and code bits,
because nothing was dumped:

mask=0x17 COREDUMP=1 SIGNAL=0 CODE=0 coredump_mask=0x4

Describe what the kernel does.

Signed-off-by: Nikolai Dokutovich <ndokutovich@xxxxxxxxx>
---
include/uapi/linux/pidfd.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/pidfd.h b/include/uapi/linux/pidfd.h
index 0919246a1611..17df4711656e 100644
--- a/include/uapi/linux/pidfd.h
+++ b/include/uapi/linux/pidfd.h
@@ -28,8 +28,8 @@
#define PIDFD_INFO_EXIT (1UL << 3) /* Only returned if requested. */
#define PIDFD_INFO_COREDUMP (1UL << 4) /* Only returned if requested. */
#define PIDFD_INFO_SUPPORTED_MASK (1UL << 5) /* Want/got supported mask flags */
-#define PIDFD_INFO_COREDUMP_SIGNAL (1UL << 6) /* Always returned if PIDFD_INFO_COREDUMP is requested. */
-#define PIDFD_INFO_COREDUMP_CODE (1UL << 7) /* Always returned if PIDFD_INFO_COREDUMP is requested. */
+#define PIDFD_INFO_COREDUMP_SIGNAL (1UL << 6) /* If requested and a coredump was recorded. */
+#define PIDFD_INFO_COREDUMP_CODE (1UL << 7) /* If requested and a coredump was recorded. */

#define PIDFD_INFO_SIZE_VER0 64 /* sizeof first published struct */
#define PIDFD_INFO_SIZE_VER1 72 /* sizeof second published struct */
--
2.43.0