lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Jun 2017 15:40:03 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Al Viro <viro@...IV.linux.org.uk>,
        Claudio Imbrenda <imbrenda@...ux.vnet.ibm.com>
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        borntraeger@...ibm.com, frankja@...ux.vnet.ibm.com
Subject: Re: [PATCH v1 1/1] KVM: add missing kvm_put_kvm in case of failure



On 27/06/2017 15:34, Al Viro wrote:
> On Tue, Jun 27, 2017 at 01:57:16PM +0200, Claudio Imbrenda wrote:
>> If I'm not missing anything, in case kvm_create_vm_debugfs fails, we
>> will have a memory leak due to not freeing the kvm object.
>>
>> A call to kvm_put_kvm was accidentally removed from an error handling in
>> commit 506cfba9e726 ("KVM: don't use anon_inode_getfd() before possible failures")
>>
>> This patch simply restores the call to kvm_put_kvm, so that the kvm
>> object is destroyed before returning an error.
>>
>> Signed-off-by: Claudio Imbrenda <imbrenda@...ux.vnet.ibm.com>
>> Fixes: 506cfba9e726 ("KVM: don't use anon_inode_getfd() before possible failures")
> 
> What you are missing is that by that point we have file->f_op already
> set, with ->release() being kvm_vm_release().  It will be called by
> final fput(), and that's what will do your "missing" kvm_put_kvm().
> 
> IOW, NAK - removal was not accidental and you've just introduced
> double-put there.

Better add a comment, I'll reuse your wording.  Thanks.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ