Skip to content

kvm: initialize all of the kvm_debugregs structure before sending it to userspace

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2179897 Upstream: Merged CVE: CVE-2023-1513

kvm: initialize all of the kvm_debugregs structure before sending it to userspace

When calling the KVM_GET_DEBUGREGS ioctl, on some configurations, there might be some unitialized portions of the kvm_debugregs structure that could be copied to userspace. Prevent this as is done in the other kvm ioctls, by setting the whole structure to 0 before copying anything into it.

Bonus is that this reduces the lines of code as the explicit flag setting and reserved space zeroing out can be removed.

Signed-off-by: Jon Maloy jmaloy@redhat.com

Edited by Jon Maloy

Merge request reports