CVE-2021-47298·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: bpf, sockmap: Fix potential memory leak on unlikely error case If skb_linearize is needed and fails we could leak a msg on the error handling. To fix ensure we kfree the msg block before returning error. Found during code review.
- Severity
- medium
- Software
- Kernel
- Fixed in
- 5.13.6
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — higher than 26% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
From: 5.11
Until: 5.13.6
Fixed in: 5.13.6
How to fix this CVE
Update your Linux kernel to version 5.13.6 or later to address a memory leak vulnerability in the BPF sockmap subsystem that occurs when SKB linearization fails. This kernel patch ensures proper cleanup of allocated message buffers during error conditions, preventing denial of service through resource exhaustion. Systems running kernel versions 5.11 through 5.13.5 should prioritize this update.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Run 'uname -r' to display the currently running kernel version and verify if it falls within the affected range (5.11 to 5.13.5)
- Check if BPF sockmap functionality is enabled in your kernel configuration by running 'grep CONFIG_BPF_SYSCALL /boot/config-$(uname -r)' and verifying the output contains 'y'
- Review dmesg logs for memory allocation failures or warnings related to skb_linearize by running 'dmesg | grep -i "skb_linearize\|memory leak\|sockmap"'
- After applying the kernel update and rebooting, confirm the new version is active with 'uname -r' and verify it is 5.13.6 or later
FAQ
What is CVE-2021-47298?
This vulnerability is a memory leak in the Linux kernel's BPF sockmap implementation that occurs when the skb_linearize function fails during packet processing. An attacker with local access could trigger repeated failures to exhaust kernel memory, resulting in a denial of service.
Is CVE-2021-47298 being actively exploited?
No, this vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog and has no public exploits available. However, the local attack vector and memory exhaustion impact make it a valid security concern for multi-tenant systems.
What versions of Kernel are affected by CVE-2021-47298?
Linux kernel versions 5.11 through 5.13.5 are vulnerable. Version 5.13.6 and later contain the fix.
How do I check if my server is vulnerable to CVE-2021-47298?
Run 'uname -r' to check your kernel version. If the output shows a version between 5.11 and 5.13.5, your system is affected. You can also cross-reference your version against the fixed version in your distribution's release notes.
Does Defensia detect CVE-2021-47298?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2021-47298 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/6c508a1c6c62793dc6e6872cad4b200097bab7c9
- https://git.kernel.org/stable/c/715f378f42909c401ec043f5150c4fdf57fb8889
- https://git.kernel.org/stable/c/7e6b27a69167f97c56b5437871d29e9722c3e470
- https://git.kernel.org/stable/c/6c508a1c6c62793dc6e6872cad4b200097bab7c9
- https://git.kernel.org/stable/c/715f378f42909c401ec043f5150c4fdf57fb8889
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-47298. Free for 1 server.
Get started free