[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6beeff56-7676-5dfd-a578-1732730f8963@redhat.com>
Date: Wed, 27 Nov 2019 19:32:32 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Leonardo Bras <leonardo@...ux.ibm.com>,
Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Paul Mackerras <paulus@...abs.org>,
Radim Krčmář <rkrcmar@...hat.com>,
kvm-ppc@...r.kernel.org, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: Add separate helper for putting borrowed reference
to kvm
On 27/11/19 19:24, Leonardo Bras wrote:
> By what I could undestand up to now, these functions that use borrowed
> references can only be called while the reference (file descriptor)
> exists.
> So, suppose these threads, where:
> - T1 uses a borrowed reference, and
> - T2 is releasing the reference (close, release):
Nit: T2 is releasing the *last* reference (as implied by your reference
to close/release).
>
> T1 | T2
> kvm_get_kvm() |
> ... | kvm_put_kvm()
> kvm_put_kvm_no_destroy() |
>
> The above would not trigger a use-after-free bug, but will cause a
> memory leak. Is my above understanding right?
Yes, this is correct.
Paolo
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists