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-next>] [day] [month] [year] [list]
Date:	Mon, 6 Apr 2009 14:27:10 +0200
From:	Jean Delvare <khali@...ux-fr.org>
To:	netdev@...r.kernel.org, Josh Boyer <jwboyer@...ux.vnet.ibm.com>
Cc:	Jeff Garzik <jgarzik@...ox.com>
Subject: [PATCH] ibm_newemac: Fix dangerous struct assumption

The ibm_newemac driver includes code which assumes that the
work_struct which is included in every delayed_work is the first
member of that structure. This is currently the case but might change
in the future, so use to_delayed_work() instead, which doesn't make
such an assumption.

Signed-off-by: Jean Delvare <khali@...ux-fr.org>
Cc: Josh Boyer <jwboyer@...ux.vnet.ibm.com>
---
 drivers/net/ibm_newemac/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.30-rc0.orig/drivers/net/ibm_newemac/core.c	2009-04-06 11:18:25.000000000 +0200
+++ linux-2.6.30-rc0/drivers/net/ibm_newemac/core.c	2009-04-06 13:29:29.000000000 +0200
@@ -1229,7 +1229,7 @@ static int emac_link_differs(struct emac
 static void emac_link_timer(struct work_struct *work)
 {
 	struct emac_instance *dev =
-		container_of((struct delayed_work *)work,
+		container_of(to_delayed_work(work),
 			     struct emac_instance, link_work);
 	int link_poll_interval;
 


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