提交 0336f8ff 编写于 作者: P Pavel Skripkin 提交者: David S. Miller

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: 1e0a8b13 ("tlan: cancel work at remove path")
Signed-off-by: NPavel Skripkin <paskripkin@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ad297cd2
...@@ -313,9 +313,8 @@ static void tlan_remove_one(struct pci_dev *pdev) ...@@ -313,9 +313,8 @@ static void tlan_remove_one(struct pci_dev *pdev)
pci_release_regions(pdev); pci_release_regions(pdev);
#endif #endif
free_netdev(dev);
cancel_work_sync(&priv->tlan_tqueue); cancel_work_sync(&priv->tlan_tqueue);
free_netdev(dev);
} }
static void tlan_start(struct net_device *dev) static void tlan_start(struct net_device *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册