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]
Message-ID: <2ced2fae-2ffd-3a70-f02c-175662baf7bc@redhat.com>
Date:   Tue, 16 Nov 2021 16:28:34 +0100
From:   Philippe Mathieu-Daudé <philmd@...hat.com>
To:     Miaoqian Lin <linmq006@...il.com>, Qiushi Wu <wu000273@....edu>
Cc:     qemu-devel@...gnu.org, linux-kernel@...r.kernel.org,
        Gabriel Somlo <somlo@....edu>,
        "Michael S. Tsirkin" <mst@...hat.com>
Subject: Re: [PATCH] fw_cfg: Fix memory leak in fw_cfg_register_file

On 11/16/21 12:42, Miaoqian Lin wrote:
> When kobject_init_and_add() fails, entry should be freed just like
> when sysfs_create_bin_file() fails.
> 

Fixes: fe3c60684377 ("firmware: Fix a reference count leak.")
Reviewed-by: Philippe Mathieu-Daudé <philmd@...hat.com>

> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
>  drivers/firmware/qemu_fw_cfg.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
> index 172c751a4f6c..0f404777f016 100644
> --- a/drivers/firmware/qemu_fw_cfg.c
> +++ b/drivers/firmware/qemu_fw_cfg.c
> @@ -608,6 +608,7 @@ static int fw_cfg_register_file(const struct fw_cfg_file *f)
>  				   fw_cfg_sel_ko, "%d", entry->select);
>  	if (err) {
>  		kobject_put(&entry->kobj);
> +		kfree(entry);
>  		return err;
>  	}
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ