Re: [PATCH v2 12/13] KVM: selftests: Verify that faulting in private guest_memfd memory fails

From: Ackerley Tng

Date: Mon Oct 06 2025 - 14:26:33 EST


Sean Christopherson <seanjc@xxxxxxxxxx> writes:

> 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@xxxxxxxxxx>

Thanks Sean!

Tested-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>

> Reviewed-by: Fuad Tabba <tabba@xxxxxxxxxx>
> Tested-by: Fuad Tabba <tabba@xxxxxxxxxx>
> Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>
> Reviewed-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> ---
> .../testing/selftests/kvm/guest_memfd_test.c | 26 +++++++++++++++----
> 1 file changed, 21 insertions(+), 5 deletions(-)
>
>
> [...snip...]
>