CVE-2025-40169

Description

A validation logic error was found in the Linux kernel's BPF verifier when checking ALU operation offsets. A local user with BPF privileges can trigger this issue by loading BPF programs containing ALU instructions with negative offset values. The verifier's check only rejected offsets greater than 1, incorrectly accepting all negative values due to signed comparison semantics. This allows malformed BPF programs to pass verification and potentially cause undefined behavior or crashes, resulting in denial of service.

Statement

BPF ALU instructions include a signed 16-bit offset field that should only be 0 or 1 (the latter for BPF_MOD/BPF_DIV operations). The check_alu_op verifier function used 'insn->off > 1' to validate this. Because insn->off is a signed s16, this comparison incorrectly accepts negative values—for example, -1 is not > 1 so it passes. The fix changes the condition to explicitly check '(insn->off != 0 && insn->off != 1)', rejecting any value outside the permitted set including all negatives. This hardens the verifier against malformed programs that might exploit unexpected offset values.

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 Score5.5N/A7.8
Attack VectorLocalN/ALocal
Attack ComplexityLowN/ALow
Privileges RequiredLowN/ALow
User InteractionNoneN/ANone
ScopeUnchangedN/AUnchanged
ConfidentialityNoneN/AHigh
Integrity ImpactNoneN/AHigh
Availability ImpactHighN/AHigh

Vector

Red Hat: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/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,Confidentiality,Availability

Technical Impact: Modify Application Data; Execute Unauthorized Code or Commands

An attacker could modify the structure of the message or data being sent to the downstream component, possibly injecting commands.

Availability

Technical Impact: DoS: Resource Consumption (Other)

in some contexts, a negative value could lead to resource consumption.

Confidentiality,Integrity

Technical Impact: Modify Memory; Read Memory

If a negative value is used to access memory, buffers, or other indexable structures, it could access memory outside the bounds of the buffer.

Frequently Asked Questions

Want to get errata notifications? Sign up here.