diff options
author | Pavel Skripkin <paskripkin@gmail.com> | 2021-07-09 17:58:29 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-09 11:01:01 -0700 |
commit | 0336f8ffece62f882ab3012820965a786a983f70 (patch) | |
tree | 88942d2c0c3b4f3873c9ed53ff04c10909fc6a93 /drivers/net | |
parent | ad297cd2db8953e2202970e9504cab247b6c7cb4 (diff) | |
download | linux-0336f8ffece62f882ab3012820965a786a983f70.tar.gz linux-0336f8ffece62f882ab3012820965a786a983f70.tar.bz2 linux-0336f8ffece62f882ab3012820965a786a983f70.zip |
net: ti: fix UAF in tlan_remove_one
priv is netdev private data and it cannot be
used after free_netdev() call. Using priv after free_netdev()
can cause UAF bug. Fix it by moving free_netdev() at the end of the
function.
Fixes: 1e0a8b13d355 ("tlan: cancel work at remove path")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/ti/tlan.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c index 0b2ce4bdc2c3..e0cb713193ea 100644 --- a/drivers/net/ethernet/ti/tlan.c +++ b/drivers/net/ethernet/ti/tlan.c @@ -313,9 +313,8 @@ static void tlan_remove_one(struct pci_dev *pdev) pci_release_regions(pdev); #endif - free_netdev(dev); - cancel_work_sync(&priv->tlan_tqueue); + free_netdev(dev); } static void tlan_start(struct net_device *dev) |