CVE Database›CVE-2024-50262

CVE-2024-50262

kernel: bpf: Fix out-of-bounds write in trie_get_next_key()

Loading…

Severity

Moderate

Red Hat Product Security

6.7

CVSS 3.1

Review impact separately from score.

Published · November 9, 2024

Updated · October 29, 2026

Description

A flaw was found in the Linux kernel's Berkeley Packet Filter (BPF) component. A privileged local attacker could exploit an out-of-bounds write vulnerability in the trie_get_next_key() function. This occurs because the function attempts to write more data than the allocated buffer size, leading to memory corruption. Successful exploitation could result in a denial of service or potentially arbitrary code execution.

Statement

The default Red Hat Enterprise Linux kernel prevents unprivileged users from being able to use eBPF by the kernel.unprivileged_bpf_disabled sysctl. This would require a privileged user with CAP_SYS_ADMIN or root to be able to abuse this flaw reducing its attack space.

For the Red Hat Enterprise Linux 9 to confirm the current state, inspect the sysctl with the command:

cat /proc/sys/kernel/unprivileged_bpf_disabled

The setting of 1 would mean that unprivileged users can not use eBPF, mitigating the flaw.

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

To mitigate this flaw, ensure that unprivileged users are prevented from using eBPF by setting the kernel.unprivileged_bpf_disabled sysctl to 1.

To confirm the current state, inspect the sysctl with the command: cat /proc/sys/kernel/unprivileged_bpf_disabled

If the value is 0, set it to 1 to disable unprivileged eBPF use: echo 1 > /proc/sys/kernel/unprivileged_bpf_disabled

To make this change persistent across reboots, add the following line to a file in /etc/sysctl.d/, for example, /etc/sysctl.d/99-disable-unprivileged-bpf.conf: kernel.unprivileged_bpf_disabled = 1 Then, apply the changes: sysctl --system

This mitigation reduces the attack surface by requiring elevated privileges for exploitation.

CVSS / CWE

CVSS 3.1 · 6.7
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

CWE-787 · Out-of-bounds Write