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: <20100106182830.4bd861fe@gmail.com>
Date:	Wed, 6 Jan 2010 18:28:30 -0600
From:	J K Cliburn <jcliburn@...il.com>
To:	Jiri Slaby <jslaby@...e.cz>
Cc:	davem@...emloft.net, linux-kernel@...r.kernel.org,
	jirislaby@...il.com, Chris Snook <chris.snook@...il.com>,
	Jie Yang <jie.yang@...eros.com>,
	atl1-devel@...ts.sourceforge.net, netdev@...r.kernel.org
Subject: Re: [PATCH 1/1] NET: atlx, fix memory leak

On Wed,  6 Jan 2010 17:54:16 +0100
Jiri Slaby <jslaby@...e.cz> wrote:

> Stanse found a memory leak in atl2_get_eeprom. eeprom_buff is not
> freed/assigned on all paths. Fix that.

Acked by: Jay Cliburn <jcliburn@...il.com>

> 
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> Cc: Jay Cliburn <jcliburn@...il.com>
> Cc: Chris Snook <chris.snook@...il.com>
> Cc: Jie Yang <jie.yang@...eros.com>
> Cc: atl1-devel@...ts.sourceforge.net
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: netdev@...r.kernel.org
> ---
>  drivers/net/atlx/atl2.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
> index c0451d7..ec52529 100644
> --- a/drivers/net/atlx/atl2.c
> +++ b/drivers/net/atlx/atl2.c
> @@ -1959,12 +1959,15 @@ static int atl2_get_eeprom(struct net_device
> *netdev, return -ENOMEM;
>  
>  	for (i = first_dword; i < last_dword; i++) {
> -		if (!atl2_read_eeprom(hw, i*4,
> &(eeprom_buff[i-first_dword])))
> -			return -EIO;
> +		if (!atl2_read_eeprom(hw, i*4,
> &(eeprom_buff[i-first_dword]))) {
> +			ret_val = -EIO;
> +			goto free;
> +		}
>  	}
>  
>  	memcpy(bytes, (u8 *)eeprom_buff + (eeprom->offset & 3),
>  		eeprom->len);
> +free:
>  	kfree(eeprom_buff);
>  
>  	return ret_val;

--
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