CVE Database›CVE-2024-50164

CVE-2024-50164

kernel: bpf: Fix overloading of MEM_UNINIT's meaning

Loading…

Severity

Moderate

Red Hat Product Security

6.7

CVSS 3.1

Review impact separately from score.

Published · November 7, 2024

Updated · October 29, 2026

Description

A flaw was found in the Linux kernel's Berkeley Packet Filter (BPF) verifier. A privileged local attacker can exploit an issue where the BPF verifier incorrectly handles memory initialization flags. This allows a BPF program to write to read-only memory maps, such as .rodata global maps, bypassing security checks. This could lead to unauthorized modification of kernel data or information disclosure.

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 issue, ensure that unprivileged eBPF is disabled by setting kernel.unprivileged_bpf_disabled to 1. This prevents unprivileged users from loading eBPF programs.

To check the current status, run:

cat /proc/sys/kernel/unprivileged_bpf_disabled

If the output is 0, enable the mitigation by running:

sudo sysctl -w kernel.unprivileged_bpf_disabled=1

To make this change persistent across reboots, add or modify the following line in /etc/sysctl.d/99-sysctl.conf (or a similar sysctl configuration file):

kernel.unprivileged_bpf_disabled = 1

Then, apply the changes:

sudo sysctl --system

Note that these actions require root privileges.

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-99 · Improper Control of Resource Identifiers ('Resource Injection')