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: <20071022133909.6a5453c7@freepuppy.rosehill>
Date:	Mon, 22 Oct 2007 13:39:09 -0700
From:	Stephen Hemminger <shemminger@...ux-foundation.org>
To:	Andrew Morton <akpm@...ux-foundation.org>,
	Jeff Garzik <jgarzik@...ox.com>
Cc:	netdev@...r.kernel.org, jkarlson@...hut.fi
Subject: [PATCH] sky2: crash on remove

Fix off-by one in remove logic that just got introduced.

Signed-off-by: Stephen Hemminger <shemminger@...ux-foundation.org>

---
This only occurs in new post 2.6.23 code.

--- a/drivers/net/sky2.c	2007-10-22 09:38:11.000000000 -0700
+++ b/drivers/net/sky2.c	2007-10-22 12:11:22.000000000 -0700
@@ -4271,7 +4271,7 @@ static void __devexit sky2_remove(struct
 	del_timer_sync(&hw->watchdog_timer);
 	cancel_work_sync(&hw->restart_work);
 
-	for (i = hw->ports; i >= 0; --i)
+	for (i = hw->ports-1; i >= 0; --i)
 		unregister_netdev(hw->dev[i]);
 
 	sky2_write32(hw, B0_IMSK, 0);
@@ -4289,7 +4289,7 @@ static void __devexit sky2_remove(struct
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
 
-	for (i = hw->ports; i >= 0; --i)
+	for (i = hw->ports-1; i >= 0; --i)
 		free_netdev(hw->dev[i]);
 
 	iounmap(hw->regs);
-
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