Skip to main content

CVE-2024-50063: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-50063cvecve-2024-50063
Published: Mon Oct 21 2024 (10/21/2024, 19:39:51 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Prevent tail call between progs attached to different hooks bpf progs can be attached to kernel functions, and the attached functions can take different parameters or return different return values. If prog attached to one kernel function tail calls prog attached to another kernel function, the ctx access or return value verification could be bypassed. For example, if prog1 is attached to func1 which takes only 1 parameter and prog2 is attached to func2 which takes two parameters. Since verifier assumes the bpf ctx passed to prog2 is constructed based on func2's prototype, verifier allows prog2 to access the second parameter from the bpf ctx passed to it. The problem is that verifier does not prevent prog1 from passing its bpf ctx to prog2 via tail call. In this case, the bpf ctx passed to prog2 is constructed from func1 instead of func2, that is, the assumption for ctx access verification is bypassed. Another example, if BPF LSM prog1 is attached to hook file_alloc_security, and BPF LSM prog2 is attached to hook bpf_lsm_audit_rule_known. Verifier knows the return value rules for these two hooks, e.g. it is legal for bpf_lsm_audit_rule_known to return positive number 1, and it is illegal for file_alloc_security to return positive number. So verifier allows prog2 to return positive number 1, but does not allow prog1 to return positive number. The problem is that verifier does not prevent prog1 from calling prog2 via tail call. In this case, prog2's return value 1 will be used as the return value for prog1's hook file_alloc_security. That is, the return value rule is bypassed. This patch adds restriction for tail call to prevent such bypasses.

AI-Powered Analysis

AILast updated: 06/28/2025, 16:54:53 UTC

Technical Analysis

CVE-2024-50063 is a vulnerability in the Linux kernel's eBPF (extended Berkeley Packet Filter) subsystem that allows bypassing of context and return value verification through improper tail calls between eBPF programs attached to different kernel hooks. eBPF programs are small pieces of code that can be attached to various kernel functions (hooks) to extend kernel functionality safely. Each kernel function has a specific prototype defining the parameters it accepts and the return values it expects. The Linux kernel includes a verifier to ensure that eBPF programs access only valid context data and return appropriate values according to the hook's prototype. The vulnerability arises because the verifier does not prevent an eBPF program (prog1) attached to one kernel function (func1) from tail calling another eBPF program (prog2) attached to a different kernel function (func2) with a different prototype. This allows prog2 to receive a context (ctx) constructed for func1 rather than func2, bypassing the verifier's assumptions. For example, if func1 takes one parameter and func2 takes two, prog2 may access the second parameter from the ctx, which does not exist, leading to undefined behavior or potential information disclosure. Similarly, return value verification can be bypassed. For instance, if prog1 is attached to a hook where returning a positive value is illegal, but prog2 (attached to a different hook) is allowed to return a positive value, prog1 can tail call prog2 and effectively return an illegal positive value, violating kernel security policies. The patch for this vulnerability adds restrictions to prevent tail calls between eBPF programs attached to different hooks, thereby enforcing correct context and return value verification and closing this bypass vector. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the patch and does not require user interaction or authentication to exploit if an attacker can load and execute eBPF programs, which typically requires elevated privileges or specific capabilities.

Potential Impact

For European organizations, this vulnerability poses a significant risk primarily in environments where Linux servers or devices run eBPF programs, such as cloud infrastructure, network appliances, and security monitoring tools. Exploiting this flaw could allow an attacker with the ability to load eBPF programs to bypass kernel security checks, potentially leading to privilege escalation, unauthorized access to kernel memory, or subversion of kernel security modules (LSMs). This could compromise confidentiality by leaking sensitive kernel data, integrity by allowing unauthorized modifications to kernel behavior, and availability if exploited to cause kernel crashes or denial of service. Given the widespread use of Linux in European data centers, telecommunications infrastructure, and critical national infrastructure, the vulnerability could have broad implications. While exploitation requires the ability to load eBPF programs (usually restricted to privileged users), insider threats or attackers who gain initial access could leverage this vulnerability to escalate privileges or evade security controls. This elevates the risk profile for sectors with high-value targets such as finance, government, healthcare, and critical infrastructure in Europe.

Mitigation Recommendations

1. Apply the official Linux kernel patches that restrict tail calls between eBPF programs attached to different hooks as soon as they are available and tested. 2. Restrict the ability to load and execute eBPF programs to trusted users only, using Linux capabilities (e.g., CAP_BPF) and secure system configurations. 3. Employ kernel lockdown features and mandatory access controls (e.g., SELinux, AppArmor) to limit the scope of eBPF program loading and execution. 4. Monitor and audit eBPF program loading activities using kernel auditing tools to detect suspicious or unauthorized eBPF usage. 5. For environments using containerization or orchestration platforms, ensure that container runtimes and orchestrators enforce strict privilege boundaries to prevent untrusted code from loading eBPF programs. 6. Keep Linux kernel versions up to date with security patches and maintain a robust patch management process. 7. Educate system administrators and security teams about the risks associated with eBPF and the importance of controlling its usage.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-10-21T19:36:19.939Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9824c4522896dcbdfe35

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

Last enriched: 6/28/2025, 4:54:53 PM

Last updated: 8/13/2025, 2:53:25 AM

Views: 22

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