CVE-2021-47520·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: can: pch_can: pch_can_rx_normal: fix use after free After calling netif_receive_skb(skb), dereferencing skb is unsafe. Especially, the can_frame cf which aliases skb memory is dereferenced just after the call netif_receive_skb(skb). Reordering the lines solves the issue.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.15.8
- Published
- 2024-05-24
Affected versions
From: 5.11
Until: 5.15.8
Fixed in: 5.15.8
How to fix this CVE
Update your Linux kernel to version 5.15.8 or later to patch a use-after-free vulnerability in the PCH CAN driver that could lead to memory corruption. This issue occurs when the kernel attempts to access CAN frame data after the network buffer has been freed by netif_receive_skb(). Apply the kernel update immediately and reboot your system to activate the patched version.
sudo dnf update kernel kernel-devel && sudo rebootDefensia detects this vulnerability
How to check if you are affected
- Check your current kernel version: uname -r — compare against 5.15.8; versions 5.11 through 5.15.7 are vulnerable
- Verify PCH CAN driver is loaded: lsmod | grep pch_can — if present, your system uses the affected driver
- Review dmesg for memory-related errors: dmesg | grep -i 'use after free\|kernel panic\|segfault' — these may indicate exploitation attempts
- Confirm the fix was applied post-reboot: uname -r should show 5.15.8 or higher, and compare file checksums: sha256sum /boot/vmlinuz-$(uname -r)
FAQ
What is CVE-2021-47520?
CVE-2021-47520 is a use-after-free vulnerability in the Linux kernel's PCH CAN controller driver where the kernel dereferences freed memory after passing a network buffer to the network stack, potentially causing memory corruption or kernel panic.
Is CVE-2021-47520 being actively exploited?
No, CVE-2021-47520 is not listed in CISA's Known Exploited Vulnerabilities catalog and no public exploits are available, though the vulnerability has high severity due to its local privilege escalation potential.
What versions of Kernel are affected by CVE-2021-47520?
Linux kernel versions 5.11 through 5.15.7 are vulnerable; kernel 5.15.8 and later contain the fix.
How do I check if my server is vulnerable to CVE-2021-47520?
Run uname -r and verify the version is between 5.11 and 5.15.7; if it is and lsmod | grep pch_can returns results, your system is vulnerable.
Does Defensia detect CVE-2021-47520?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2021-47520 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/3a3c46e2eff0577454860a203be1a8295f4acb76
- https://git.kernel.org/stable/c/3e193ef4e0a3f5bf92ede83ef214cb09d01b00aa
- https://git.kernel.org/stable/c/6c73fc931658d8cbc8a1714b326cb31eb71d16a7
- https://git.kernel.org/stable/c/703dde112021c93d6e89443c070e7dbd4dea612e
- https://git.kernel.org/stable/c/94cddf1e9227a171b27292509d59691819c458db
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47520. Free for 1 server.
Get started free