From 92e584fe443995bbb84069a4d13ea8ebedb5c5c8 Mon Sep 17 00:00:00 2001 From: Moni Shoua Date: Sun, 8 Feb 2015 11:49:32 +0200 Subject: net/bonding: Fix potential bad memory access during bonding events When queuing work to send the NETDEV_BONDING_INFO netdev event, it's possible that when the work is executed, the pointer to the slave becomes invalid. This can happen if between queuing the event and the execution of the work, the net-device was un-ensvaled and re-enslaved. Fix that by queuing a work with the data of the slave instead of the slave structure. Fixes: 69e6113343cf ('net/bonding: Notify state change on slaves') Reported-by: Nikolay Aleksandrov Signed-off-by: Moni Shoua Signed-off-by: Or Gerlitz Signed-off-by: David S. Miller --- include/net/bonding.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/net/bonding.h') diff --git a/include/net/bonding.h b/include/net/bonding.h index 4e17095ad46a..fda6feeb6c1f 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h @@ -152,8 +152,8 @@ struct bond_parm_tbl { struct netdev_notify_work { struct delayed_work work; - struct slave *slave; struct net_device *dev; + struct netdev_bonding_info bonding_info; }; struct slave { -- cgit v1.2.3-59-g8ed1b