CVE-2023-52462

Description

A flaw was found in the Linux kernel. When the register is spilled onto a stack as a 1/2/4-byte register, the slot_type[BPF_REG_SIZE - 1]  is set, possibly including a few more below it, depending on the actual spill size. To confirm if some stack slots have a spilled register, consult slot_type[7], not slot_type[0]. To avoid the need to remember and double-check this in the future, use the is_spilled_reg() helper.

Statement

This vulnerability is rated as Low severity because exploiting the BPF verifier flaw requires local execution privileges and, in default Red Hat Enterprise Linux environments, elevated administrative capabilities. Red Hat Enterprise Linux disables unprivileged eBPF by default, meaning an attacker must already possess CAP_BPF or CAP_SYS_ADMIN rights to load arbitrary BPF programs. Consequently, the blast radius is constrained to environments where untrusted users have already obtained high-level administrative capabilities, preventing unauthorized privilege escalation by ordinary local users.

Mitigation

Ensure unprivileged eBPF usage is disabled via the sysctl parameter.

To disable unprivileged eBPF immediately:
# sysctl -w kernel.unprivileged_bpf_disabled=1

To ensure this configuration persists across system restarts, add the setting to a sysctl configuration file:
# echo 'kernel.unprivileged_bpf_disabled = 1' > /etc/sysctl.d/99-bpf-disable.conf

Caveats: While this sysctl is enabled by default on standard Red Hat Enterprise Linux installations, it restricts program loading to privileged users with CAP_BPF or CAP_SYS_ADMIN. It does not mitigate exploitation by users or processes that already possess these elevated capabilities.

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 Score4.45.5N/A
Attack VectorLocalLocalN/A
Attack ComplexityLowLowN/A
Privileges RequiredHighLowN/A
User InteractionNoneNoneN/A
ScopeUnchangedUnchangedN/A
ConfidentialityNoneNoneN/A
Integrity ImpactHighHighN/A
Availability ImpactNoneNoneN/A

Vector

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

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

Understanding the Weakness (CWE)

Availability,Integrity,Confidentiality

Technical Impact: Read Memory; Modify Memory; Execute Unauthorized Code or Commands; DoS: Crash, Exit, or Restart

When a memory buffer is accessed using the wrong type, it could read or write memory out of the bounds of the buffer, if the allocated buffer is smaller than the type that the code is attempting to access, leading to a crash and possibly code execution.

Frequently Asked Questions

Want to get errata notifications? Sign up here.