From: Kees Cook <keescook@chromium.org>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Zheng Zhang <zheng.zhang@email.ucr.edu>
Subject: Re: [PATCH 1/7] KVM: Grab a reference to KVM for VM and vCPU stats file descriptors
Date: Wed, 12 Jul 2023 13:04:48 -0700 [thread overview]
Message-ID: <202307121303.85C768B3BD@keescook> (raw)
In-Reply-To: <20230711230131.648752-2-seanjc@google.com>
On Tue, Jul 11, 2023 at 04:01:25PM -0700, Sean Christopherson wrote:
> 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>
Thanks for preparing this! Looks like the common get/put code pattern,
so I can review this patch, unlike the rest of the series. :)
Reviewed-by: Kees Cook <keescook@chromium.org>
--
Kees Cook
next prev parent reply other threads:[~2023-07-12 20:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 23:01 [PATCH 0/7] KVM: Grab KVM references for stats fds Sean Christopherson
2023-07-11 23:01 ` [PATCH 1/7] KVM: Grab a reference to KVM for VM and vCPU stats file descriptors Sean Christopherson
2023-07-12 20:04 ` Kees Cook [this message]
2023-07-11 23:01 ` [PATCH 2/7] KVM: selftests: Use pread() to read binary stats header Sean Christopherson
2023-07-11 23:01 ` [PATCH 3/7] KVM: selftests: Clean up stats fd in common stats_test() helper Sean Christopherson
2023-07-11 23:01 ` [PATCH 4/7] KVM: selftests: Explicitly free vcpus array in binary stats test Sean Christopherson
2023-07-11 23:01 ` [PATCH 5/7] KVM: selftests: Verify userspace can create "redundant" binary stats files Sean Christopherson
2023-07-11 23:01 ` [PATCH 6/7] KVM: selftests: Verify stats fd can be dup()'d and read Sean Christopherson
2023-07-11 23:01 ` [PATCH 7/7] KVM: selftests: Verify stats fd is usable after VM fd has been closed Sean Christopherson
2023-07-26 15:17 ` [PATCH 0/7] KVM: Grab KVM references for stats fds Sean Christopherson
2023-07-29 15:02 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202307121303.85C768B3BD@keescook \
--to=keescook@chromium.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=zheng.zhang@email.ucr.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox