From: Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx> Date: Fri, 21 Nov 2014 23:52:53 -0800 > From: Daniel Borkmann <dborkman@xxxxxxxxxx> > > While working on a different issue, I noticed an annoying use > after free bug on my machine when unloading the ixgbe driver: ... > The issue is that test_and_set_bit() done on adapter->state is being > performed *after* the netdevice has been freed via free_netdev(). > > When netdev is being allocated on initialization time, it allocates > a private area, here struct ixgbe_adapter, that resides after the > net_device structure. In ixgbe_probe(), the device init routine, > we set up the adapter after alloc_etherdev_mq() on the private area > and add a reference for the pci_dev as well via pci_set_drvdata(). > > Both in the error path of ixgbe_probe(), but also on module unload > when ixgbe_remove() is being called, commit 41c62843eb6a ("ixgbe: > Fix rcu warnings induced by LER") accesses adapter after free_netdev(). > The patch stores the result in a bool and thus fixes above oops on my > side. > > Fixes: 41c62843eb6a ("ixgbe: Fix rcu warnings induced by LER") > Cc: stable <stable@xxxxxxxxxxxxxxx> > Cc: Mark Rustad <mark.d.rustad@xxxxxxxxx> > Signed-off-by: Daniel Borkmann <dborkman@xxxxxxxxxx> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx> Applied. -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html