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:	Tue, 18 Jan 2011 16:14:31 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	bcrl@...ck.org
Cc:	jj@...osbits.net, netdev@...r.kernel.org, linux-ns83820@...ck.org,
	linux-kernel@...r.kernel.org, tj@...nel.org, segooon@...il.com,
	dkirjanov@...nel.org
Subject: Re: [PATCH] ns83820: Avoid bad pointer deref in ns83820_init_one().

From: Benjamin LaHaise <bcrl@...ck.org>
Date: Tue, 18 Jan 2011 11:42:00 -0500

> On Mon, Jan 17, 2011 at 09:24:57PM +0100, Jesper Juhl wrote:
>> In drivers/net/ns83820.c::ns83820_init_one() we dynamically allocate 
>> memory via alloc_etherdev(). We then call PRIV() on the returned storage 
>> which is 'return netdev_priv()'. netdev_priv() takes the pointer it is 
>> passed and adds 'ALIGN(sizeof(struct net_device), NETDEV_ALIGN)' to it and 
>> returns it. Then we test the resulting pointer for NULL, which it is 
>> unlikely to be at this point, and later dereference it. This will go bad 
>> if alloc_etherdev() actually returned NULL.
>> 
>> This patch reworks the code slightly so that we test for a NULL pointer 
>> (and return -ENOMEM) directly after calling alloc_etherdev().
> 
> Looks good.
> 
> 		-ben
> 
> Signed-off-by: Benjamin LaHaise <bcrl@...ck.org>

Applied, thanks everyone.
--
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