powerpc/ptrace: Preserve previous fprs/vsrs on short regset write
authorDave Martin <Dave.Martin@arm.com>
Thu, 5 Jan 2017 16:50:57 +0000 (16:50 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:18:45 +0000 (02:18 +0000)
commit 99dfe80a2a246c600440a815741fd2e74a8b4977 upstream.

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

Fixes: c6e6771b87d4 ("powerpc: Introduce VSX thread_struct and CONFIG_VSX")
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
[bwh: Backported to 3.2:
 - fpscr and fpr are direct members of struct thread_struct
 - Use memcpy() for fpscr, like the reverse copy below, to avoid type error
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

No differences found