[v2,5/6] MIPS: Also verify sizeof `elf_fpreg_t' with PTRACE_SETREGSET
diff mbox series

Message ID
State Accepted
Delegated to: Ralf Baechle
Headers show
Series
  • MIPS: NT_PRFPREG regset handling fixes
Related show

Commit Message

Maciej W. Rozycki Dec. 11, 2017, 10:55 p.m. UTC
Complement commit d614fd58a283 ("mips/ptrace: Preserve previous 
registers for short regset write") and like with the PTRACE_GETREGSET 
ptrace(2) request also apply a BUILD_BUG_ON check for the size of the 
`elf_fpreg_t' type in the PTRACE_SETREGSET request handler.

Cc:  # v4.11+
Fixes: d614fd58a283 ("mips/ptrace: Preserve previous registers for short regset write")
Signed-off-by: Maciej W. Rozycki <>
---

No changes from v1.

---
 arch/mips/kernel/ptrace.c |    1 +
 1 file changed, 1 insertion(+)

linux-mips-nt-prfpreg-build-bug.diff

Patch
diff mbox series

Index: linux-sfr-test/arch/mips/kernel/ptrace.c
===================================================================
--- linux-sfr-test.orig/arch/mips/kernel/ptrace.c	:33: +0000
+++ linux-sfr-test/arch/mips/kernel/ptrace.c	:52: +0000
@@ -438,6 +438,7 @@  static int fpr_get_msa(struct task_struc
 	u64 fpr_val;
 	int err;
 
+	BUILD_BUG_ON(sizeof(fpr_val) != sizeof(elf_fpreg_t));
 	for (i = 0; i < NUM_FPU_REGS; i++) {
 		fpr_val = get_fpr64(&target->thread.fpu.fpr[i], 0);
 		err = user_regset_copyout(pos, count, kbuf, ubuf,