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, 12 Jul 2016 12:24:39 +0200
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Liu Shuo <shuo.a.liu@...el.com>, linux-kernel@...r.kernel.org,
	kvm@...r.kernel.org
Cc:	Zhang Yanmin <yanmin_zhang@...ux.intel.com>,
	He Bo <bo.he@...el.com>, Liu Shuo <shuox.liu@...il.com>,
	Radim Krčmář <rkrcmar@...hat.com>
Subject: Re: [PATCH] KVM: release anon file in failure path of vm creation



On 12/07/2016 11:38, Liu Shuo wrote:
> The failure of create debugfs of VM will return directly without release
> the anon file. It will leak memory and file descriptors, even through
> be not serious.
> 
> Signed-off-by: Liu Shuo <shuo.a.liu@...el.com>
> ---
>  virt/kvm/kvm_main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 48bd520..8322154 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -49,6 +49,7 @@
>  #include <linux/slab.h>
>  #include <linux/sort.h>
>  #include <linux/bsearch.h>
> +#include <linux/syscalls.h>
>  
>  #include <asm/processor.h>
>  #include <asm/io.h>
> @@ -3067,6 +3068,7 @@ static int kvm_dev_ioctl_create_vm(unsigned long type)
>  
>  	if (kvm_create_vm_debugfs(kvm, r) < 0) {
>  		kvm_put_kvm(kvm);
> +		sys_close(r);
>  		return -ENOMEM;
>  	}
>  
> 

Thanks, applied to kvm/master.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ