Thread (19 messages) read the whole thread 19 messages, 9 authors, 10d ago

Re: [PATCH v4 5/8] powerpc: add exit_flags field in pt_regs

From: Mukesh Kumar Chaurasiya <hidden>
Date: 2026-07-22 10:30:42
Also in: lkml

On Wed, Jul 22, 2026 at 09:54:43AM +0200, Florian Weimer wrote:
* Dmitry V. Levin:
quoted
On Fri, Jan 23, 2026 at 01:09:13PM +0530, Mukesh Kumar Chaurasiya wrote:
quoted
From: Mukesh Kumar Chaurasiya <redacted>

Add a new field `exit_flags` in the pt_regs structure. This field will hold
the flags set during interrupt or syscall execution that are required during
exit to user mode.
Apparently, this change breaks PTRACE_GETREGS as the latter has no means
to communicate the size of struct pt_regs being written to userspace.

As result, the kernel with this patch will write to userpsace 32 more
bytes than before, and unless the userspace is re-compiled with the latest
ptrace.h, 32 bytes of userspace memory after struct pt_regs will be
overwritten.

This issue was detected by strace test suite, specifically, the test that
checks whether the actual number of bytes written by
ptrace(PTRACE_GETREGS) matches sizeof(struct pt_regs), and that test failed
with runtime version v7.1 and headers version v7.2-rc1.
I think this needs to be reverted because it breaks existing ptrace
users.  This isn't like iptables, where kernel updates did mandate
specific versions of the userspace tools.

Thanks,
Florian
Hey,

Thanks for reporting this. I was unaware that this would break userspace.
I am working on a fix for this, I am trying to maintain this state
somewhere else than pt_regs. That would make the userspace work without
recompilation.

Regards,
Mukesh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help