net: ethernet: fix potential use-after-free in ec_bhf_remove
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 6af55ff52b02d492d45db88df3e461fa51a6f753 · < 95deeb29d831e2fae608439e243e7a520611e7ea| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
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.
From the CVE record · Linux
The Linux kernel Ethernet driver can access network-device private data after freeing it during device removal. This can cause a use-after-free; the input does not establish whether an attacker can trigger it or whether access or user interaction is required.
Teams running Linux kernels with the affected Ethernet driver should check their versions against the vendor advisory; affected versions are not specified.