arm64: ptrace: fix empty registers set in prstatus of aarch32 process core
authorVictor Kamensky <victor.kamensky@linaro.org>
Tue, 3 Jun 2014 18:21:30 +0000 (19:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:11:54 +0000 (20:11 -0700)
commitffd6802830d5909dee42c4d786e420288a43815d
treef84a95b85bc2f2cbafee5e9b7128f192c70ca282
parent5a0713d8c4595bf562245c1137488de30cc4757b
arm64: ptrace: fix empty registers set in prstatus of aarch32 process core

commit 2227901a0230d8fde81ba9c602d649839390f56b upstream.

Currently core file of aarch32 process prstatus note has empty
registers set. As result aarch32 core files create by V8 kernel are
not very useful.

It happens because compat_gpr_get and compat_gpr_set functions can
copy registers values to/from either kbuf or ubuf. ELF core file
collection function fill_thread_core_info calls compat_gpr_get
with kbuf set and ubuf set to 0. But current compat_gpr_get and
compat_gpr_set function handle copy to/from only ubuf case.

Fix is to handle kbuf and ubuf as two separate cases in similar
way as other functions like user_regset_copyout, user_regset_copyin do.

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/ptrace.c