summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ti
diff options
context:
space:
mode:
authorPavel Skripkin <paskripkin@gmail.com>2021-07-09 17:58:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-28 12:13:45 +0300
commita0a817b2d308fac090a05cbbe80988e073ac5193 (patch)
tree0a503d8c8fb821ab89f0ea10426d03402000bc49 /drivers/net/ethernet/ti
parent11e9d163d631198bb3eb41a677a61b499516c0f7 (diff)
downloadlinux-a0a817b2d308fac090a05cbbe80988e073ac5193.tar.xz
net: ti: fix UAF in tlan_remove_one
commit 0336f8ffece62f882ab3012820965a786a983f70 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r--drivers/net/ethernet/ti/tlan.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
index 01f99e5df145..9f2129623d18 100644
--- a/drivers/net/ethernet/ti/tlan.c
+++ b/drivers/net/ethernet/ti/tlan.c
@@ -312,9 +312,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)