]> Gentwo Git Trees - linux/.git/commit
KVM: selftests: Verify that faulting in private guest_memfd memory fails
authorSean Christopherson <seanjc@google.com>
Fri, 3 Oct 2025 23:26:05 +0000 (16:26 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 10 Oct 2025 21:25:30 +0000 (14:25 -0700)
commit19942d4fd9cf022b28a9afb432a6338dcf96fc2f
treeacc866796e89cf4ec9e2bf843fe4812c3718cc9b
parentf91187c0ecc6358ccecf533c5fcc6b7dbb4735cb
KVM: selftests: Verify that faulting in private guest_memfd memory fails

Add a guest_memfd testcase to verify that faulting in private memory gets
a SIGBUS.  For now, test only the case where memory is private by default
since KVM doesn't yet support in-place conversion.

Deliberately run the CoW test with and without INIT_SHARED set as KVM
should disallow MAP_PRIVATE regardless of whether the memory itself is
private from a CoCo perspective.

Cc: Ackerley Tng <ackerleytng@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Ackerley Tng <ackerleytng@google.com>
Tested-by: Ackerley Tng <ackerleytng@google.com>
Link: https://lore.kernel.org/r/20251003232606.4070510-13-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/guest_memfd_test.c