]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xtensa: fix coprocessor part of ptrace_{get,set}xregs
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 27 Nov 2018 02:06:01 +0000 (18:06 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Dec 2018 18:41:23 +0000 (19:41 +0100)
commitd36e4ee3b3ce4cf93e8fa145841287bbdb140fec
tree3cc438a14e92ab57fdcaac0153083f4115fb44c9
parentb35182226166c03713a10ffebcf2838569c95d57
xtensa: fix coprocessor part of ptrace_{get,set}xregs

commit 38a35a78c5e270cbe53c4fef6b0d3c2da90dd849 upstream.

Layout of coprocessor registers in the elf_xtregs_t and
xtregs_coprocessor_t may be different due to alignment. Thus it is not
always possible to copy data between the xtregs_coprocessor_t structure
and the elf_xtregs_t and get correct values for all registers.
Use a table of offsets and sizes of individual coprocessor register
groups to do coprocessor context copying in the ptrace_getxregs and
ptrace_setxregs.
This fixes incorrect coprocessor register values reading from the user
process by the native gdb on an xtensa core with multiple coprocessors
and registers with high alignment requirements.

Cc: stable@vger.kernel.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/xtensa/kernel/ptrace.c