diff options
author | Pavel Skripkin <paskripkin@gmail.com> | 2021-06-18 16:49:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-18 23:01:17 +0300 |
commit | 9cca0c2d70149160407bda9a9446ce0c29b6e6c6 (patch) | |
tree | 2665950cb2d0dc90397cf0c63063a80ef4d2777e /include | |
parent | 0d1dc9e1f4c03c2819f0557226c5322e405be3cb (diff) | |
download | linux-9cca0c2d70149160407bda9a9446ce0c29b6e6c6.tar.xz |
net: ethernet: fix potential use-after-free in ec_bhf_remove
static void ec_bhf_remove(struct pci_dev *dev)
{
...
struct ec_bhf_priv *priv = netdev_priv(net_dev);
unregister_netdev(net_dev);
free_netdev(net_dev);
pci_iounmap(dev, priv->dma_io);
pci_iounmap(dev, priv->io);
...
}
priv is netdev private data, but it is used
after free_netdev(). It can cause use-after-free when accessing priv
pointer. So, fix it by moving free_netdev() after pci_iounmap()
calls.
Fixes: 6af55ff52b02 ("Driver for Beckhoff CX5020 EtherCAT master module.")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions