CVE-2024-49861·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix helper writes to read-only maps Lonial found an issue that despite user- and BPF-side frozen BPF map (like in case of .rodata), it was still possible to write into it from a BPF program side through specific helpers having ARG_PTR_TO_{LONG,INT} as arguments. In check_func_arg() when the argument is as mentioned, the meta->raw_mode is never set. Later, check_helper_mem_access(), under the case of PTR_TO_MAP_VALUE as register base type, it assumes BPF_READ for the subsequent call to check_map_access_type() and given the BPF map is read-only it succeeds. The helpers really need to be annotated as ARG_PTR_TO_{LONG,INT} | MEM_UNINIT when results are written into them as opposed to read out of them. The latter indicates that it's okay to pass a pointer to uninitialized memory as the memory is written to anyway. However, ARG_PTR_TO_{LONG,INT} is a special case of ARG_PTR_TO_FIXED_SIZE_MEM just with additional alignment requirement. So it is better to just get rid of the ARG_PTR_TO_{LONG,INT} special cases altogether and reuse the fixed size memory types. For this, add MEM_ALIGNED to additionally ensure alignment given these helpers write directly into the args via *<ptr> = val. The .arg*_size has been initialized reflecting the actual sizeof(*<ptr>). MEM_ALIGNED can only be used in combination with MEM_FIXED_SIZE annotated argument types, since in !MEM_FIXED_SIZE cases the verifier does not know the buffer size a priori and therefore cannot blindly write *<ptr> = val.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.11.2
- Published
- 2024-10-21
Affected versions
From: 6.11
Until: 6.11.2
Fixed in: 6.11.2
How to fix this CVE
Update your Linux kernel to version 6.11.2 or later to patch the BPF map write vulnerability. This fix prevents malicious BPF programs from bypassing read-only protections on kernel maps (such as .rodata sections) through specific helper functions. Ensure all systems running kernel versions 6.11.0 through 6.11.1 are patched immediately.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check the running kernel version with 'uname -r' and compare against the affected range (6.11.0-6.11.1)
- Step 2: Verify BPF is enabled in the kernel with 'grep CONFIG_BPF /boot/config-$(uname -r)' — if CONFIG_BPF=y, the system is vulnerable if unpatched
- Step 3: Search kernel audit logs for BPF program loads with 'sudo grep -i bpf /var/log/audit/audit.log | grep -i "prog_load"' to identify any suspicious BPF activity
- Step 4: After patching, confirm the new kernel is running with 'uname -r' and verify it shows 6.11.2 or later
FAQ
What is CVE-2024-49861?
CVE-2024-49861 is a kernel vulnerability that allows BPF programs to write to read-only kernel maps (like .rodata) by exploiting improper memory access checks in BPF helper functions. An attacker with BPF program execution privileges can bypass frozen map protections and modify kernel data structures.
Is CVE-2024-49861 being actively exploited?
No, CVE-2024-49861 is not listed in CISA's Known Exploited Vulnerabilities catalog and no public exploits are currently available. However, the vulnerability requires kernel 6.11.x which is relatively new, limiting real-world exposure.
What versions of Kernel are affected by CVE-2024-49861?
Linux kernel versions 6.11.0, 6.11.1, and 6.11.2 (before the patch) are affected. The fix is included in kernel 6.11.2 and later stable releases.
How do I check if my server is vulnerable to CVE-2024-49861?
Run 'uname -r' to get your kernel version. If it shows 6.11.0 or 6.11.1, your system is vulnerable. Additionally, confirm BPF is enabled with 'grep CONFIG_BPF /boot/config-$(uname -r)'.
Does Defensia detect CVE-2024-49861?
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-2024-49861 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/1e75d25133158b525e0456876e9bcfd6b2993fd5
- https://git.kernel.org/stable/c/2ed98ee02d1e08afee88f54baec39ea78dc8a23c
- https://git.kernel.org/stable/c/32556ce93bc45c730829083cb60f95a2728ea48b
- https://git.kernel.org/stable/c/988e55abcf7fdb8fc9a76a7cf3f4e939a4d4fb3a
- https://git.kernel.org/stable/c/a2c8dc7e21803257e762b0bf067fd13e9c995da0
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-49861. Free for 1 server.
Get started free