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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 21 Jun 2007 17:30:10 +0530
From:	"pradeep singh" <pradeep.rautela@...il.com>
To:	trivial@...nel.org
Cc:	jgarzik@...ox.com, akpm@...ux-foundation.org,
	netdev@...r.kernel.org
Subject: [PATCH v2.6.22-rc5] cxgb2: handle possible NULL pointer dereferencing

Hi,

Chelsio's in kernel 10G driver does not checks the return value from
t1_get_board_info() in cxgb2.c.
t1_get_board_info may return a NULL and we still go on to dereference
it in the for loop without checking for the NULL.

This patch fixes this.

Signed-off-by: Pradeep Singh <pradeep.rautela@...il.com>
---
 drivers/net/chelsio/cxgb2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 231ce43..edcfeba 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -1023,7 +1023,7 @@ static int __devinit init_one(struct pci_dev *pdev,
 	mmio_len = pci_resource_len(pdev, 0);
 	bi = t1_get_board_info(ent->driver_data);

-	for (i = 0; i < bi->port_number; ++i) {
+	for (i = 0; bi && i < bi->port_number; ++i) {
 		struct net_device *netdev;

 		netdev = alloc_etherdev(adapter ? 0 : sizeof(*adapter));
-- 
1.4.4.2
Thanks

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