CVE-2024-43840
kernel: bpf, arm64: Fix trampoline for BPF_TRAMP_F_CALL_ORIG
Severity
LowRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · August 17, 2024
Updated · October 17, 2026
Description
In the Linux kernel, the following vulnerability has been resolved:
bpf, arm64: Fix trampoline for BPF_TRAMP_F_CALL_ORIG
When BPF_TRAMP_F_CALL_ORIG is set, the trampoline calls __bpf_tramp_enter() and __bpf_tramp_exit() functions, passing them the struct bpf_tramp_image *im pointer as an argument in R0.
The trampoline generation code uses emit_addr_mov_i64() to emit instructions for moving the bpf_tramp_image address into R0, but emit_addr_mov_i64() assumes the address to be in the vmalloc() space and uses only 48 bits. Because bpf_tramp_image is allocated using kzalloc(), its address can use more than 48-bits, in this case the trampoline will pass an invalid address to __bpf_tramp_enter/exit() causing a kernel crash.
Fix this by using emit_a64_mov_i64() in place of emit_addr_mov_i64() as it can work with addresses that are greater than 48-bits.
Statement
A flaw was found in the Linux kernel's BPF trampoline implementation on the 64-bit ARM (arm64) architecture. When a BPF trampoline is created with the BPF_TRAMP_F_CALL_ORIG flag, the arm64 JIT emits instructions that load the address of the struct bpf_tramp_image into R0 for the __bpf_tramp_enter() and __bpf_tramp_exit() calls. The emit_addr_mov_i64() helper assumes a vmalloc() address and encodes only 48 bits, but bpf_tramp_image is allocated with kzalloc(), so its address can use more than 48 bits. The trampoline then passes an invalid address to __bpf_tramp_enter()/__bpf_tramp_exit(), causing a kernel crash (denial of service). Only arm64 systems are affected, and triggering the crash requires local access with the privileges needed to load BPF programs, so Red Hat rates the impact of this flaw as Low. Red Hat Enterprise Linux 9 (kernel and kernel-rt) on arm64 is affected, but the fix is deferred for the affected RHEL 9 streams; the residual risk is that a privileged local user could trigger a kernel crash, causing denial of service, with no impact on confidentiality or integrity. Red Hat Enterprise Linux 6, 7, and 8 are not affected because the vulnerable code was introduced upstream in kernel 6.0. In Fedora, which follows the upstream community kernel, this has been addressed through community kernel updates. The CVEorg record scores this flaw 7.8 (Important) with high confidentiality and integrity impact; however, the defect can only crash the kernel and does not disclose or modify data, which is why Red Hat (4.4, Moderate) and NIST (5.5, Moderate) rate it lower with availability-only impact.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.
CVSS / CWE
CVSS 3.1 · 4.4CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H
CWE-682 · Incorrect Calculation