Skip to contentSkip to conversation

Patch "MIPS: Also verify sizeof `elf_fpreg_t' with PTRACE_SETREGSET" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Jan 10, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

MIPS: Also verify sizeof `elf_fpreg_t' with PTRACE_SETREGSET

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mips-also-verify-sizeof-elf_fpreg_t-with-ptrace_setregset.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 006501e039eec411842bb3150c41358867d320c2 Mon Sep 17 00:00:00 2001

From: "Maciej W. Rozycki" <[email protected]>
Date: Mon, 11 Dec 2017 22:55:40 +0000
Subject: MIPS: Also verify sizeof `elf_fpreg_t' with PTRACE_SETREGSET

From: Maciej W. Rozycki <[email protected]>

commit 006501e039eec411842bb3150c41358867d320c2 upstream.

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.

Fixes d614fd58a283 ("mips/ptrace: Preserve previous registers for short regset write")
Cc James Hogan <[email protected]>
Cc Paul Burton <[email protected]>
Cc Alex Smith <[email protected]>
Cc Dave Martin <[email protected]>

Patchwork: https://patchwork.linux-mips.org/patch/17929/

---
 arch/mips/kernel/ptrace.c |    1 +
 1 file changed, 1 insertion(+)
arch/mips/kernel/ptrace.c +1 -0
@@ -416,6 +416,7 @@ static int fpr_get(struct task_struct *t
 					   &target->thread.fpu,
 					   0, sizeof(elf_fpregset_t));
 
+	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,

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/mips-also-verify-sizeof-elf_fpreg_t-with-ptrace_setregset.patch