]> git.itanic.dy.fi Git - linux-stable/commit
s390/ptrace: Preserve previous registers for short regset write
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 24 Jan 2017 07:05:52 +0000 (08:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2017 07:30:52 +0000 (08:30 +0100)
commitbae49e72f95155dd22ee6e80f6b4eb360469b7d6
treef6560dc3ba7ed8f3a8445decd68289f8a8c45ba8
parent8637de3a318df6b84a91c7d3b988fab8668f94ee
s390/ptrace: Preserve previous registers for short regset write

commit 9dce990d2cf57b5ed4e71a9cdbd7eae4335111ff upstream.

Ensure that if userspace supplies insufficient data to
PTRACE_SETREGSET to fill all the registers, the thread's old
registers are preserved.

convert_vx_to_fp() is adapted to handle only a specified number of
registers rather than unconditionally handling all of them: other
callers of this function are adapted appropriately.

Based on an initial patch by Dave Martin.

Reported-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kernel/ptrace.c