CVE-2024-49861: Vulnerability in Linux Linux
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.
AI Analysis
Technical Summary
CVE-2024-49861 is a vulnerability identified in the Linux kernel's Berkeley Packet Filter (BPF) subsystem. The issue arises from improper enforcement of read-only restrictions on certain BPF maps, specifically those marked as frozen or read-only (e.g., .rodata). The vulnerability allows a BPF program to write to these read-only maps through specific helper functions that accept arguments annotated as ARG_PTR_TO_LONG or ARG_PTR_TO_INT. The root cause is that during argument validation in check_func_arg(), the meta->raw_mode flag is not set for these argument types, leading check_helper_mem_access() to incorrectly assume a read-only access (BPF_READ) when verifying permissions. Consequently, the verifier permits writes to read-only maps, violating intended memory protections. The fix involves re-annotating these helper arguments to include MEM_UNINIT and MEM_ALIGNED flags, ensuring proper alignment and indicating that the memory is written to rather than read from. This change also removes the special cases for ARG_PTR_TO_LONG/INT in favor of ARG_PTR_TO_FIXED_SIZE_MEM with alignment, enabling the verifier to correctly enforce write restrictions. This vulnerability affects Linux kernel versions identified by the given commit hashes and was publicly disclosed on October 21, 2024. No known exploits are currently reported in the wild. The vulnerability could allow a local attacker with the ability to load or execute BPF programs to write to memory regions that should be immutable, potentially leading to privilege escalation, data corruption, or bypass of security mechanisms relying on read-only BPF maps.
Potential Impact
For European organizations, this vulnerability poses a significant risk primarily to systems running vulnerable Linux kernel versions with BPF enabled and accessible to unprivileged or semi-privileged users capable of loading BPF programs. The BPF subsystem is widely used for networking, observability, and security tools, so exploitation could undermine the integrity of security monitoring, firewall rules, or other kernel-level protections. Successful exploitation could lead to privilege escalation, allowing attackers to gain root-level access or persist undetected by modifying supposedly immutable kernel data structures. This could impact critical infrastructure, cloud services, telecommunications, and enterprise environments prevalent in Europe. Additionally, the ability to write to read-only maps could facilitate advanced attacks such as kernel code manipulation or bypassing security modules, increasing the potential for data breaches or service disruptions. Given the widespread use of Linux in European data centers, government agencies, and industrial control systems, the vulnerability could have broad implications if exploited.
Mitigation Recommendations
European organizations should prioritize updating their Linux kernels to versions that include the patch for CVE-2024-49861 as soon as it becomes available. Until patches are applied, organizations should restrict the ability to load or execute BPF programs to trusted users only, ideally limiting this capability to root or highly privileged accounts. Employing Linux Security Modules (LSMs) like SELinux or AppArmor with strict policies can help prevent unauthorized BPF program loading. Monitoring and auditing BPF program loads and executions can provide early detection of exploitation attempts. Network segmentation and isolation of critical systems running vulnerable kernels can reduce exposure. For cloud environments, ensure that container runtimes and orchestration platforms enforce strict privilege boundaries and do not allow untrusted containers to load BPF programs. Finally, organizations should review and harden kernel parameters related to BPF and consider disabling BPF features if not required for operational needs.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Italy, Spain, Poland, Belgium
CVE-2024-49861: Vulnerability in Linux Linux
Description
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.
AI-Powered Analysis
Technical Analysis
CVE-2024-49861 is a vulnerability identified in the Linux kernel's Berkeley Packet Filter (BPF) subsystem. The issue arises from improper enforcement of read-only restrictions on certain BPF maps, specifically those marked as frozen or read-only (e.g., .rodata). The vulnerability allows a BPF program to write to these read-only maps through specific helper functions that accept arguments annotated as ARG_PTR_TO_LONG or ARG_PTR_TO_INT. The root cause is that during argument validation in check_func_arg(), the meta->raw_mode flag is not set for these argument types, leading check_helper_mem_access() to incorrectly assume a read-only access (BPF_READ) when verifying permissions. Consequently, the verifier permits writes to read-only maps, violating intended memory protections. The fix involves re-annotating these helper arguments to include MEM_UNINIT and MEM_ALIGNED flags, ensuring proper alignment and indicating that the memory is written to rather than read from. This change also removes the special cases for ARG_PTR_TO_LONG/INT in favor of ARG_PTR_TO_FIXED_SIZE_MEM with alignment, enabling the verifier to correctly enforce write restrictions. This vulnerability affects Linux kernel versions identified by the given commit hashes and was publicly disclosed on October 21, 2024. No known exploits are currently reported in the wild. The vulnerability could allow a local attacker with the ability to load or execute BPF programs to write to memory regions that should be immutable, potentially leading to privilege escalation, data corruption, or bypass of security mechanisms relying on read-only BPF maps.
Potential Impact
For European organizations, this vulnerability poses a significant risk primarily to systems running vulnerable Linux kernel versions with BPF enabled and accessible to unprivileged or semi-privileged users capable of loading BPF programs. The BPF subsystem is widely used for networking, observability, and security tools, so exploitation could undermine the integrity of security monitoring, firewall rules, or other kernel-level protections. Successful exploitation could lead to privilege escalation, allowing attackers to gain root-level access or persist undetected by modifying supposedly immutable kernel data structures. This could impact critical infrastructure, cloud services, telecommunications, and enterprise environments prevalent in Europe. Additionally, the ability to write to read-only maps could facilitate advanced attacks such as kernel code manipulation or bypassing security modules, increasing the potential for data breaches or service disruptions. Given the widespread use of Linux in European data centers, government agencies, and industrial control systems, the vulnerability could have broad implications if exploited.
Mitigation Recommendations
European organizations should prioritize updating their Linux kernels to versions that include the patch for CVE-2024-49861 as soon as it becomes available. Until patches are applied, organizations should restrict the ability to load or execute BPF programs to trusted users only, ideally limiting this capability to root or highly privileged accounts. Employing Linux Security Modules (LSMs) like SELinux or AppArmor with strict policies can help prevent unauthorized BPF program loading. Monitoring and auditing BPF program loads and executions can provide early detection of exploitation attempts. Network segmentation and isolation of critical systems running vulnerable kernels can reduce exposure. For cloud environments, ensure that container runtimes and orchestration platforms enforce strict privilege boundaries and do not allow untrusted containers to load BPF programs. Finally, organizations should review and harden kernel parameters related to BPF and consider disabling BPF features if not required for operational needs.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-10-21T12:17:06.017Z
- Cisa Enriched
- true
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9825c4522896dcbe07ce
Added to database: 5/21/2025, 9:08:53 AM
Last enriched: 6/28/2025, 8:42:44 PM
Last updated: 8/14/2025, 2:34:33 PM
Views: 17
Related Threats
CVE-2025-53948: CWE-415 Double Free in Santesoft Sante PACS Server
HighCVE-2025-52584: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-46269: CWE-122 Heap-based Buffer Overflow in Ashlar-Vellum Cobalt
HighCVE-2025-54862: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumCVE-2025-54759: CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') in Santesoft Sante PACS Server
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.