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) <[email protected]>
---
 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


Reply via email to