CVE-2024-50203

Description

A flaw was found in the Linux kernel. Specifically, within the Berkeley Packet Filter (BPF) component, an issue arises when BPF_TRAMP_F_CALL_ORIG is enabled. During address emission, an incorrect size calculation can lead to a heap buffer overflow, where more data is written to a memory block than it was allocated for. This could allow a privileged local attacker to potentially cause a denial of service or execute arbitrary code. The default kernel configuration restricts unprivileged users from using eBPF, which reduces the attack surface for this vulnerability.

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 8 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.

Mitigation

Ensure the `kernel.unprivileged_bpf_disabled` sysctl is set to `1` to prevent unprivileged users from utilizing eBPF. This is the default configuration in Red Hat Enterprise Linux.
To verify the current setting:

bash
cat /proc/sys/kernel/unprivileged_bpf_disabled
If the value is `0`, set it to `1` for the current session using:
bash
sysctl -w kernel.unprivileged_bpf_disabled=1
To make this change persistent across reboots, add `kernel.unprivileged_bpf_disabled = 1` to a new file in `/etc/sysctl.d/` (e.g., `/etc/sysctl.d/99-disable-unprivileged-bpf.conf`) and then apply with `sysctl -p`. This action limits the functionality of unprivileged eBPF programs.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

The following CVSS metrics and score provided are preliminary and subject to review.

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score6.77.87.8
Attack VectorLocalLocalLocal
Attack ComplexityLowLowLow
Privileges RequiredHighLowLow
User InteractionNoneNoneNone
ScopeUnchangedUnchangedUnchanged
ConfidentialityHighHighHigh
Integrity ImpactHighHighHigh
Availability ImpactHighHighHigh

Vector

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

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

cve.org: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Understanding the Weakness (CWE)

Integrity

Technical Impact: Modify Memory; Execute Unauthorized Code or Commands

Write operations could cause memory corruption. In some cases, an adversary can modify control data such as return addresses in order to execute unexpected code.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

Attempting to access out-of-range, invalid, or unauthorized memory could cause the product to crash.

Other

Technical Impact: Unexpected State

Subsequent write operations can produce undefined or unexpected results.

Frequently Asked Questions

Want to get errata notifications? Sign up here.