Skip to content
Snippets Groups Projects
Commit ec495f2a authored by Sean Christopherson's avatar Sean Christopherson
Browse files

KVM: Write the per-page "segment" when clearing (part of) a guest page


Pass "seg" instead of "len" when writing guest memory in kvm_clear_guest(),
as "seg" holds the number of bytes to write for the current page, while
"len" holds the total bytes remaining.

Luckily, all users of kvm_clear_guest() are guaranteed to not cross a page
boundary, and so the bug is unhittable in the current code base.

Fixes: 2f541442 ("KVM: remove kvm_clear_guest_page")
Reported-by: default avatar <zyr_ms@outlook.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219104
Link: https://lore.kernel.org/r/20240829191413.900740-2-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent e027ba1b
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment