Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/uapi: Fix sigcontext definition to use user_pt_regs

My recent patch to split pt_regs between user and kernel missed
the usage in struct sigcontext.

Because this is a user visible struct it should be using the user
visible definition, which when we're building for the kernel is called
struct user_pt_regs.

As far as I can see this hasn't actually caused a bug (yet), because
we don't use the sizeof() the sigcontext->regs anywhere. But we should
still fix it to avoid confusion and future bugs.

Fixes: 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")
Reported-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

+5 -1
+5 -1
arch/powerpc/include/uapi/asm/sigcontext.h
··· 22 22 #endif 23 23 unsigned long handler; 24 24 unsigned long oldmask; 25 - struct pt_regs __user *regs; 25 + #ifdef __KERNEL__ 26 + struct user_pt_regs __user *regs; 27 + #else 28 + struct pt_regs *regs; 29 + #endif 26 30 #ifdef __powerpc64__ 27 31 elf_gregset_t gp_regs; 28 32 elf_fpregset_t fp_regs;