CVE-2024-50262

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.

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.

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

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.