CVE-2021-47235·Kernel vulnerability
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.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.12.13
- Published
- 2024-05-21
Affected versions
From: 5.11
Until: 5.12.13
Fixed in: 5.12.13
How to fix this CVE
Update your Linux kernel to version 5.12.13 or later to resolve a use-after-free vulnerability in the EtherCAT master device driver. This flaw allows local attackers with standard user privileges to cause memory corruption or system crashes. Prioritize this update for systems running kernel versions 5.11 through 5.12.12 that have EtherCAT hardware present.
sudo dnf update kernel kernel-devel kernel-headersDefensia detects this vulnerability
How to check if you are affected
- Run 'uname -r' to check your current kernel version and confirm if it falls between 5.11 and 5.12.12
- Check if EtherCAT master driver is loaded with 'lsmod | grep ec_bhf' — if output is empty, this specific vulnerability vector is not active
- Search kernel logs with 'sudo dmesg | grep -i "use-after-free\|ec_bhf\|memory corruption"' for signs of exploitation attempts
- After patching, verify the new kernel version with 'uname -r' and confirm it shows 5.12.13 or later, then reboot if necessary
FAQ
What is CVE-2021-47235?
CVE-2021-47235 is a use-after-free vulnerability in the Linux kernel's EtherCAT master device driver that occurs during device removal, allowing local users to trigger memory corruption and potential system instability.
Is CVE-2021-47235 being actively exploited?
No, this vulnerability is not listed in the CISA KEV catalog and no public exploits are available, though the high CVSS score of 7.8 warrants prompt patching.
What versions of Kernel are affected by CVE-2021-47235?
Linux kernel versions 5.11 through 5.12.12 are vulnerable; the fix was released in kernel 5.12.13.
How do I check if my server is vulnerable to CVE-2021-47235?
Run 'uname -r' to check your kernel version, then run 'lsmod | grep ec_bhf' to verify if the affected EtherCAT driver is in use on your system.
Does Defensia detect CVE-2021-47235?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2021-47235 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/0260916843cc74f3906acf8b6f256693e01530a2
- https://git.kernel.org/stable/c/19f88ca68ccf8771276a606765239b167654f84a
- https://git.kernel.org/stable/c/1cafc540b7bf1b6a5a77dc000205fe337ef6eba6
- https://git.kernel.org/stable/c/95deeb29d831e2fae608439e243e7a520611e7ea
- https://git.kernel.org/stable/c/9cca0c2d70149160407bda9a9446ce0c29b6e6c6
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47235. Free for 1 server.
Get started free