[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20141123.142709.2057383946565296456.davem@davemloft.net>
Date: Sun, 23 Nov 2014 14:27:09 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: jeffrey.t.kirsher@...el.com
Cc: dborkman@...hat.com, netdev@...r.kernel.org, nhorman@...hat.com,
sassmann@...hat.com, jogreene@...hat.com, stable@...r.kernel.org,
mark.d.rustad@...el.com
Subject: Re: [net 2/3] ixgbe: fix use after free adapter->state test in
ixgbe_remove/ixgbe_probe
From: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Date: Fri, 21 Nov 2014 23:52:53 -0800
> From: Daniel Borkmann <dborkman@...hat.com>
>
> 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@...r.kernel.org>
> Cc: Mark Rustad <mark.d.rustad@...el.com>
> Signed-off-by: Daniel Borkmann <dborkman@...hat.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Applied.
--
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