]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.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)
committerSultan Alsawaf <sultan.alsawaf@canonical.com>
Wed, 24 Jul 2019 15:44:57 +0000 (09:44 -0600)
commit2d031ce8d4b58c5cc8bca5a7dccb47fc6e6ef713
tree2ad6eb06389553bee0e200b185c0b252cd2b3f63
parent31cdac27cfba270f0dc751392527f2b89646192c
xtensa: fix coprocessor part of ptrace_{get,set}xregs

BugLink: https://bugs.launchpad.net/bugs/1836968
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/xtensa/kernel/ptrace.c