Re: [PATCH 3/3] KVM: x86: Fix broken debugregs ABI for 32 bit kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 03, 2024, Mathias Krause wrote:
> 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.

And this has always been broken, so if there were ever users of 32-bit KVM, they
obviously didn't use this API :-)

If the code weren't also a cleanup for 64-bit, I would vote to change the APIs
to just fail for 32-bit.  But there's just no good reason to assume that the
layouts of KVM's internal storage and "struct kvm_debugregs" are identical.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux