diff options
author | Mathias Krause <minipli@grsecurity.net> | 2024-02-03 13:45:22 +0100 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-02-05 15:40:54 -0800 |
commit | e1dda3afe2a9f466940d44db8baaaf6c0ff8793f (patch) | |
tree | e9843a0fa7a49785ce37a4a522f36bc8297137aa /scripts/gdb/linux/proc.py | |
parent | 955997e880175b00161efb83b1b282849ff412d3 (diff) |
KVM: x86: Fix broken debugregs ABI for 32 bit kernels
The ioctl()s to get and set KVM's debug registers are broken for 32 bit
kernels as they'd only copy half of the user register state because of a
UAPI and in-kernel type mismatch (__u64 vs. unsigned long; 8 vs. 4
bytes).
This makes it impossible for userland to set anything but DR0 without
resorting to bit folding tricks.
Switch to a loop for copying debug registers that'll implicitly do the
type conversion for us, if needed.
There are likely no users (left) for 32bit KVM, fix the bug nonetheless.
Fixes: a1efbe77c1fd ("KVM: x86: Add support for saving&restoring debug registers")
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20240203124522.592778-4-minipli@grsecurity.net
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'scripts/gdb/linux/proc.py')
0 files changed, 0 insertions, 0 deletions