From: "Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>
To: maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
chleroy@kernel.org, mkchauras@linux.ibm.com,
sshegde@linux.ibm.com, mkchauras@gmail.com,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH] powerpc/ptrace: Add offsetof check for exit_flags in pt_regs_check()
Date: Fri, 3 Jul 2026 13:19:48 +0530 [thread overview]
Message-ID: <20260703074948.1668744-1-mkchauras@gmail.com> (raw)
pt_regs_check() verifies that fields shared between struct pt_regs and
struct user_pt_regs sit at the same offset, to catch any accidental
layout divergence between the kernel and uapi structures.
Add the missing check for exit_flags, following the same pattern as the
existing checks for result, dsisr, dar and the other shared fields.
Fixes: d7a6797e0bc1 ("powerpc: add exit_flags field in pt_regs")
Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
---
arch/powerpc/kernel/ptrace/ptrace.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/ptrace/ptrace.c b/arch/powerpc/kernel/ptrace/ptrace.c
index 316d4f5ead8e..fb3fec73f66a 100644
--- a/arch/powerpc/kernel/ptrace/ptrace.c
+++ b/arch/powerpc/kernel/ptrace/ptrace.c
@@ -235,6 +235,8 @@ void __init pt_regs_check(void)
offsetof(struct user_pt_regs, dsisr));
BUILD_BUG_ON(offsetof(struct pt_regs, result) !=
offsetof(struct user_pt_regs, result));
+ BUILD_BUG_ON(offsetof(struct pt_regs, exit_flags) !=
+ offsetof(struct user_pt_regs, exit_flags));
BUILD_BUG_ON(sizeof(struct user_pt_regs) > sizeof(struct pt_regs));
--
2.55.0
next reply other threads:[~2026-07-03 7:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 7:49 Mukesh Kumar Chaurasiya (IBM) [this message]
2026-07-03 8:55 ` [PATCH] powerpc/ptrace: Add offsetof check for exit_flags in pt_regs_check() Amit Machhiwal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260703074948.1668744-1-mkchauras@gmail.com \
--to=mkchauras@gmail.com \
--cc=chleroy@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mkchauras@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=sshegde@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox