Skip to content

Commit 962b95a

Browse files
Dave Martingregkh
authored andcommitted
sparc/ptrace: Preserve previous registers for short regset write
commit d3805c546b275c8cc7d40f759d029ae92c7175f2 upstream. Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET to fill all the registers, the thread's old registers are preserved. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c869366 commit 962b95a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/sparc/kernel/ptrace_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int genregs64_set(struct task_struct *target,
311311
}
312312

313313
if (!ret) {
314-
unsigned long y;
314+
unsigned long y = regs->y;
315315

316316
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
317317
&y,

0 commit comments

Comments
 (0)