# CVE-2021-47235: net: ethernet: fix potential use-after-free in ec\_bhf\_remove

- Priority: **Routine**
- Reason: Not severe (CVSS 7.8, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-05-21 · Modified: 2026-05-11
- Aliases: UBUNTU-CVE-2021-47235, DEBIAN-CVE-2021-47235
- Record: https://cvemate.com/vulnerability/CVE-2021-47235 · JSON: https://cvemate.com/vulnerability/CVE-2021-47235/json

## Description

```text
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.
```

## Signals

- CVSS: 7.8 high (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.228%, percentile 14.539%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 90)

- debian linux (Debian): \< 5.10.46-1
- ubuntu linux (Ubuntu): \< 4.4.0-267.301 \| \< 4.15.0-156.163 \| \< 5.4.0-81.91
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): \< 4.4.0-1142.148 \| \< 4.4.0-1180.195 \| \< 4.15.0-1111.118 \| \< 5.4.0-1055.58
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): \< 5.4.0-1055.58~18.04.1
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-fips (Ubuntu): \< 4.15.0-2053.55 \| All versions (No fix recorded) \| \< 5.4.0-1069.73+fips2
- ubuntu linux-aws-hwe (Ubuntu): \< 4.15.0-1111.118~16.04.1
- ubuntu linux-azure (Ubuntu): \< 4.15.0-1123.136~14.04.1 \| \< 4.15.0-1123.136~16.04.1 \| All versions (No fix recorded) \| \< 5.4.0-1056.58
- ubuntu linux-azure-4.15 (Ubuntu): \< 4.15.0-1123.136
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.3 (Ubuntu): All versions (No fix recorded)

## References

- <https://git.kernel.org/stable/c/db2bc3cfd2bc01621014d4f17cdfc74611f339c8>
- <https://git.kernel.org/stable/c/1cafc540b7bf1b6a5a77dc000205fe337ef6eba6>
- <https://git.kernel.org/stable/c/b1ad283755095a4b9d1431aeb357d7df1a33d3bb>
- <https://git.kernel.org/stable/c/0260916843cc74f3906acf8b6f256693e01530a2>
- <https://git.kernel.org/stable/c/19f88ca68ccf8771276a606765239b167654f84a>
- <https://git.kernel.org/stable/c/95deeb29d831e2fae608439e243e7a520611e7ea>
- <https://git.kernel.org/stable/c/d11d79e52ba080ee567cb7d7eb42a5ade60a8130>
- <https://git.kernel.org/stable/c/9cca0c2d70149160407bda9a9446ce0c29b6e6c6>
- <https://ubuntu.com/security/CVE-2021-47235>
- <https://www.cve.org/CVERecord?id=CVE-2021-47235>
- <https://git.kernel.org/linus/9cca0c2d70149160407bda9a9446ce0c29b6e6c6>
- <https://ubuntu.com/security/notices/USN-7429-1>
- <https://ubuntu.com/security/notices/USN-7429-2>
- <https://security-tracker.debian.org/tracker/CVE-2021-47235>

---

Data as of 2026-12-05T04:23:43.335Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
