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] [day] [month] [year] [list]
Date:	Sun, 30 Nov 2014 10:28:39 +0200
From:	Vladimir Kondratiev <qca_vkondrat@....qualcomm.com>
To:	"John W. Linville" <linville@...driver.com>
CC:	Lino Sanfilippo <LinoSanfilippo@....de>, <netdev@...r.kernel.org>,
	<ahmedtamrawi@...il.com>, <davem@...emloft.net>,
	<linux-wireless@...r.kernel.org>
Subject: Re: [PATCH] wil6210: Fix potential memory leaks on error paths

On Friday, November 28, 2014 02:47:19 AM Lino Sanfilippo wrote:
> Fix missing memory deallocation on error paths in wil_write_file_wmi()
> and wil_write_file_txmgmt().
> 
> Reported-by: Ahmed Tamrawi <ahmedtamrawi@...il.com>
> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@....de>
> ---
>  drivers/net/wireless/ath/wil6210/debugfs.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
> index 54a6ddc..4e6e145 100644
> --- a/drivers/net/wireless/ath/wil6210/debugfs.c
> +++ b/drivers/net/wireless/ath/wil6210/debugfs.c
> @@ -573,8 +573,10 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf,
>  	if (!frame)
>  		return -ENOMEM;
>  
> -	if (copy_from_user(frame, buf, len))
> +	if (copy_from_user(frame, buf, len)) {
> +		kfree(frame);
>  		return -EIO;
> +	}
>  
>  	params.buf = frame;
>  	params.len = len;
> @@ -614,8 +616,10 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
>  		return -ENOMEM;
>  
>  	rc = simple_write_to_buffer(wmi, len, ppos, buf, len);
> -	if (rc < 0)
> +	if (rc < 0) {
> +		kfree(wmi);
>  		return rc;
> +	}
>  
>  	cmd = &wmi[1];
>  	cmdid = le16_to_cpu(wmi->id);
> 

Lino and Ahmed: thanks for that. Here is my
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@....qualcomm.com>

John: please merge
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ