Bug 4500 - [ANCK 5.10] kvm: initialize all of the kvm_debugregs structure before sending it to userspace
Summary: [ANCK 5.10] kvm: initialize all of the kvm_debugregs structure before sending...
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: virt (show other bugs) virt
Version: 5.10.y-9
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: YTFD-oa
QA Contact: shuming
URL:
Whiteboard:
Keywords:
: 4353 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-03-13 20:02 UTC by YTFD-oa
Modified: 2023-03-14 11:10 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description YTFD-oa 2023-03-13 20:02:15 UTC
Description of problem:
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.

see upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2c10b61421a28e95a46ab489fd56c0f442ff6952
Comment 2 Joseph Qi alibaba_cloud_group 2023-03-14 11:10:12 UTC
*** Bug 4353 has been marked as a duplicate of this bug. ***