[LTP] [PATCH v1 1/1] ioctl_pidfd06: expect EREMOTE for PIDFD_GET_INFO across pidns

Jan Polensky japo@linux.ibm.com
Wed Feb 18 20:02:30 CET 2026


Kernel changed PIDFD_GET_INFO semantics when the pidfd refers to a task
that has no PID in the caller's current pid namespace: return -EREMOTE
instead of -ESRCH, allowing userspace to distinguish “different pidns”
from “process exited”.

Update ioctl_pidfd06 to expect EREMOTE in that case.

Link: https://www.spinics.net/lists/linux-fsdevel/msg326699.html
Link: https://lkml.org/lkml/2026/2/16/608
Link: https://lore.kernel.org/r/20260214010245.3671907-34-sashal@kernel.org
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
---
 testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c b/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c
index 751281bacb74..81205afb72a6 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_pidfd06.c
@@ -41,7 +41,7 @@ static void run(void)
 	args->exit_signal = SIGCHLD;
 
 	if (!SAFE_CLONE(args)) {
-		TST_EXP_FAIL(ioctl(pidfd, PIDFD_GET_INFO, info), ESRCH);
+		TST_EXP_FAIL(ioctl(pidfd, PIDFD_GET_INFO, info), EREMOTE);
 		exit(0);
 	}
 
-- 
2.53.0



More information about the ltp mailing list