]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: ptrace: Fix VFP register dumping in compat coredumps
authorDave Martin <Dave.Martin@arm.com>
Wed, 21 Jun 2017 15:00:42 +0000 (16:00 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 22 Jun 2017 14:58:19 +0000 (15:58 +0100)
commitf914885e336686b275afcde34aa7dccd99f0a8b9
treec74ef3292b52b8bba5a1d92d7c654b73fd9073dd
parent53029713f9f7eb8c43de0f0f746d1801148b3f46
arm64: ptrace: Fix VFP register dumping in compat coredumps

Currently, VFP registers are omitted from coredumps for compat
processes, due to a bug in the REGSET_COMPAT_VFP regset
implementation.

compat_vfp_get() needs to transfer non-contiguous data from
thread_struct.fpsimd_state, and uses put_user() to handle the
offending trailing word (FPSCR).  This fails when copying to a
kernel address (i.e., kbuf && !ubuf), which is what happens when
dumping core.  As a result, the ELF coredump core code silently
omits the NT_ARM_VFP note from the dump.

It would be possible to work around this with additional special
case code for the put_user(), but since user_regset_copyout() is
explicitly designed to handle this scenario it is cleaner to port
the put_user() to a user_regset_copyout() call, which this patch
does.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/ptrace.c