All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] KVM: guest_memfd: Fix signed offset+size goof
@ 2026-05-28  2:11 Sean Christopherson
  2026-05-28  2:11 ` [PATCH v3 1/3] KVM: guest_memfd: Treat memslot binding offset+size as unsigned values Sean Christopherson
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Sean Christopherson @ 2026-05-28  2:11 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kvm, linux-kernel, Ackerley Tng, Sean Christopherson

Fix a bug where KVM fails to reject a comically large offset into guest_memfd
if offset+size results in a signed, negative value.  Add a testcase to prove
the bug, and to serve as a regression test.

Note, v1 and v2 was part of larger series.

v3:
 - Use uoff_t, not u64. [the combined might of Sean and Ackerley]
 - Explaining exactly what is broken. [Ackerley]
 - Add a regression test.

v2: https://lore.kernel.org/all/20260522-fix-sev-gmem-post-populate-v2-0-3f196bfad5a1@google.com
v1: https://lore.kernel.org/r/20260522-fix-sev-gmem-post-populate-v1-0-9fc8d6437b65@google.com

Sean Christopherson (3):
  KVM: guest_memfd: Treat memslot binding offset+size as unsigned values
  KVM: selftests: Expand the guest_memfd test macros to allow passing
    the VM
  KVM: selftests: Add guest_memfd regression test signed offset+size bug

 .../testing/selftests/kvm/guest_memfd_test.c  | 24 +++++++++++++++++--
 virt/kvm/guest_memfd.c                        |  8 +++----
 virt/kvm/kvm_mm.h                             |  7 ++++--
 3 files changed, 31 insertions(+), 8 deletions(-)


base-commit: 9f2a49c511cb05b85745e1578e4fd425bff87f58
-- 
2.54.0.794.g4f17f83d09-goog


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-06-02 17:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28  2:11 [PATCH v3 0/3] KVM: guest_memfd: Fix signed offset+size goof Sean Christopherson
2026-05-28  2:11 ` [PATCH v3 1/3] KVM: guest_memfd: Treat memslot binding offset+size as unsigned values Sean Christopherson
2026-05-28  3:00   ` sashiko-bot
2026-05-28 17:24   ` Ackerley Tng
2026-05-28 17:57     ` Sean Christopherson
2026-05-28 20:42       ` Ackerley Tng
2026-05-28 23:25   ` Michael Roth
2026-05-28  2:11 ` [PATCH v3 2/3] KVM: selftests: Expand the guest_memfd test macros to allow passing the VM Sean Christopherson
2026-05-30 23:18   ` Ackerley Tng
2026-05-28  2:11 ` [PATCH v3 3/3] KVM: selftests: Add guest_memfd regression test signed offset+size bug Sean Christopherson
2026-05-28  3:29   ` sashiko-bot
2026-05-30 23:17     ` Ackerley Tng
2026-06-02 17:01       ` Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.