Skip to content

KVM: selftests: guest_memfd close() fix and hardening

Sean Christopherson kvm linux-kselftest lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: selftests: Cast guest_memfd fd to a signed int when checking for >= 0tools/testing/selftests/kvm/lib/kvm_util.c+1 -12 replies
2/2KVM: selftests: Add and use kvm_free_fd() to harden against fd goofstools/testing/selftests/kvm/include/kvm_syscalls.h tools/testing/selftests/kvm/lib/kvm_util.c+17 -121 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAckerley TngBibo Mao
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: selftests: guest_memfd close() fix and hardening

Fix a bug where freeing a VM attempts to close an invalid guest_memfd instance due to checking if a u32 value is non-negative. Then harden closing of fds in kvm_util by invalidating fds after they are closed, e.g. so that freeing an fd multiple times will fail instead of silently closing the wrong file.

Sean Christopherson (2):
KVM: selftests: Cast guest_memfd fd to a signed int when checking for

Quoted 1 line

= 0

KVM: selftests: Add and use kvm_free_fd() to harden against fd goofs

 .../selftests/kvm/include/kvm_syscalls.h      |  6 +++++
 tools/testing/selftests/kvm/lib/kvm_util.c    | 25 +++++++++----------
 2 files changed, 18 insertions(+), 13 deletions(-)

base-commit: 66939c1603bd5579e63278f9dc72cba5b79da9b5

Signature · 1 line
2.54.0.794.g4f17f83d09-goog