]> git.ipfire.org Git - thirdparty/linux.git/commit
powerpc: Fix exit_flags field placement in pt_regs for ptrace
authorMukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
Thu, 23 Jul 2026 19:48:09 +0000 (01:18 +0530)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Tue, 28 Jul 2026 04:53:31 +0000 (10:23 +0530)
commit263e5159e00aa46bf26f3496ff7aae1fc9a6c826
treef1633364afd97b9cc15185c24f697ddc89f0b516
parentbddf7540099bf653eaea339e886add6f62555cf3
powerpc: Fix exit_flags field placement in pt_regs for ptrace

Commit d7a6797e0bc1 ("powerpc: add exit_flags field in pt_regs") added
the exit_flags field to struct pt_regs to pass internal exit control
flags (e.g. _TIF_RESTOREALL) from syscall_exit_prepare() to the
low-level assembly exit path.

However, the field was placed in a way that was visible to userspace
tools such as strace via PTRACE_GETREGS, or caused a struct layout or
size regression observable through ptrace. The field is purely
kernel-internal and must not be exposed beyond the user_pt_regs
boundary.

Move exit_flags into struct thread_info where it is only accessible to
the kernel, and keep it out of the ptrace-visible register window
entirely.

Fixes: d7a6797e0bc1 ("powerpc: add exit_flags field in pt_regs")
Reported-by: Dmitry V. Levin <ldv@strace.io>
Closes: https://lore.kernel.org/all/20260722070155.GA11808@strace.io/
Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260723194809.4046600-1-mkchauras@gmail.com
arch/powerpc/include/asm/ptrace.h
arch/powerpc/include/asm/thread_info.h
arch/powerpc/include/uapi/asm/ptrace.h
arch/powerpc/kernel/interrupt.c
arch/powerpc/kernel/ptrace/ptrace.c
arch/powerpc/kernel/signal.c