summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/kvm_binary_stats_test.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2023-07-12 02:01:25 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2023-07-29 18:05:28 +0300
commiteed3013faa401aae662398709410a59bb0646e32 (patch)
tree5775b56237d85e8791a7a72e91cb9dca570ba1b9 /tools/testing/selftests/kvm/kvm_binary_stats_test.c
parent3bcbc20942db5d738221cca31a928efc09827069 (diff)
downloadlinux-eed3013faa401aae662398709410a59bb0646e32.tar.xz
KVM: Grab a reference to KVM for VM and vCPU stats file descriptors
Grab a reference to KVM prior to installing VM and vCPU stats file descriptors to ensure the underlying VM and vCPU objects are not freed until the last reference to any and all stats fds are dropped. Note, the stats paths manually invoke fd_install() and so don't need to grab a reference before creating the file. Fixes: ce55c049459c ("KVM: stats: Support binary stats retrieval for a VCPU") Fixes: fcfe1baeddbf ("KVM: stats: Support binary stats retrieval for a VM") Reported-by: Zheng Zhang <zheng.zhang@email.ucr.edu> Closes: https://lore.kernel.org/all/CAC_GQSr3xzZaeZt85k_RCBd5kfiOve8qXo7a81Cq53LuVQ5r=Q@mail.gmail.com Cc: stable@vger.kernel.org Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Message-Id: <20230711230131.648752-2-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/kvm_binary_stats_test.c')
0 files changed, 0 insertions, 0 deletions