Skip to main content

CVE-2024-47702: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-47702cvecve-2024-47702
Published: Mon Oct 21 2024 (10/21/2024, 11:53:37 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Fail verification for sign-extension of packet data/data_end/data_meta syzbot reported a kernel crash due to commit 1f1e864b6555 ("bpf: Handle sign-extenstin ctx member accesses"). The reason is due to sign-extension of 32-bit load for packet data/data_end/data_meta uapi field. The original code looks like: r2 = *(s32 *)(r1 + 76) /* load __sk_buff->data */ r3 = *(u32 *)(r1 + 80) /* load __sk_buff->data_end */ r0 = r2 r0 += 8 if r3 > r0 goto +1 ... Note that __sk_buff->data load has 32-bit sign extension. After verification and convert_ctx_accesses(), the final asm code looks like: r2 = *(u64 *)(r1 +208) r2 = (s32)r2 r3 = *(u64 *)(r1 +80) r0 = r2 r0 += 8 if r3 > r0 goto pc+1 ... Note that 'r2 = (s32)r2' may make the kernel __sk_buff->data address invalid which may cause runtime failure. Currently, in C code, typically we have void *data = (void *)(long)skb->data; void *data_end = (void *)(long)skb->data_end; ... and it will generate r2 = *(u64 *)(r1 +208) r3 = *(u64 *)(r1 +80) r0 = r2 r0 += 8 if r3 > r0 goto pc+1 If we allow sign-extension, void *data = (void *)(long)(int)skb->data; void *data_end = (void *)(long)skb->data_end; ... the generated code looks like r2 = *(u64 *)(r1 +208) r2 <<= 32 r2 s>>= 32 r3 = *(u64 *)(r1 +80) r0 = r2 r0 += 8 if r3 > r0 goto pc+1 and this will cause verification failure since "r2 <<= 32" is not allowed as "r2" is a packet pointer. To fix this issue for case r2 = *(s32 *)(r1 + 76) /* load __sk_buff->data */ this patch added additional checking in is_valid_access() callback function for packet data/data_end/data_meta access. If those accesses are with sign-extenstion, the verification will fail. [1] https://lore.kernel.org/bpf/000000000000c90eee061d236d37@google.com/

AI-Powered Analysis

AILast updated: 06/28/2025, 19:42:05 UTC

Technical Analysis

CVE-2024-47702 is a vulnerability identified in the Linux kernel's eBPF (extended Berkeley Packet Filter) subsystem, specifically related to the verification process of sign-extension operations on packet data pointers such as data, data_end, and data_meta within the __sk_buff structure. The vulnerability arises from improper handling of sign-extension when loading 32-bit values from these packet data pointers, which can lead to invalid kernel addresses and cause runtime failures or kernel crashes. The root cause is that the eBPF verifier did not correctly fail verification for sign-extended accesses to these packet pointers, allowing potentially unsafe operations. The patch introduced additional checks in the is_valid_access() callback to ensure that any sign-extended access to packet data pointers fails verification, preventing invalid memory access and maintaining kernel stability. This vulnerability was discovered through syzbot-triggered kernel crashes and is linked to commit 1f1e864b6555, which attempted to handle sign-extension in context member accesses but inadvertently introduced this verification gap. The issue is technical and specific to how the eBPF verifier processes 32-bit loads and sign-extension, which is critical for maintaining the integrity and security of kernel memory access in eBPF programs.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems running vulnerable Linux kernel versions that support eBPF, which is widely used for networking, monitoring, and security purposes. Exploitation could lead to kernel crashes (denial of service) or potentially more severe impacts if attackers leverage the invalid memory access to escalate privileges or execute arbitrary code within the kernel context. This could disrupt critical infrastructure, cloud services, and enterprise environments relying on Linux servers. Given the prevalence of Linux in European data centers, telecommunications, and government systems, the vulnerability could affect availability and integrity of services. However, exploitation requires crafting specific eBPF programs that trigger the sign-extension flaw, which may limit widespread exploitation. Nonetheless, the risk to high-value targets such as financial institutions, telecom providers, and public sector entities is significant due to potential service disruption and security breaches.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernels to versions that include the patch addressing CVE-2024-47702. Since this vulnerability affects the eBPF verifier, kernel updates from trusted Linux distributions (e.g., Debian, Ubuntu, Red Hat, SUSE) should be applied promptly. Additionally, organizations should audit and restrict the ability to load eBPF programs to trusted users and processes only, as unprivileged eBPF loading can increase risk. Employing kernel lockdown features and mandatory access controls (e.g., SELinux, AppArmor) can further reduce attack surface. Monitoring kernel logs for unusual eBPF verifier failures or crashes can help detect exploitation attempts. Finally, organizations running custom or embedded Linux kernels should backport the patch or apply vendor-provided fixes to ensure protection.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-09-30T16:00:12.945Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9825c4522896dcbe0550

Added to database: 5/21/2025, 9:08:53 AM

Last enriched: 6/28/2025, 7:42:05 PM

Last updated: 7/26/2025, 9:24:54 AM

Views: 8

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats