CVE-2025-22048

LoongArch: BPF: Don't override subprog's return value

MEDIUM
5.5
CVSS Score
Published: April 16, 2025 at 02:12 PM UTC
Updated: August 5, 2026 at 12:44 PM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%

Description

In the Linux kernel, the following vulnerability has been resolved: LoongArch: BPF: Don't override subprog's return value The verifier test `calls: div by 0 in subprog` triggers a panic at the ld.bu instruction. The ld.bu insn is trying to load byte from memory address returned by the subprog. The subprog actually set the correct address at the a5 register (dedicated register for BPF return values). But at commit 73c359d1d356 ("LoongArch: BPF: Sign-extend return values") we also sign extended a5 to the a0 register (return value in LoongArch). For function call insn, we later propagate the a0 register back to a5 register. This is right for native calls but wrong for bpf2bpf calls which expect zero-extended return value in a5 register. So only move a0 to a5 for native calls (i.e. non-BPF_PSEUDO_CALL).

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 6.1.120v ≥ 6.11.116.1.120 ≤ v < 6.26.11.11 ≤ v < 6.126.12.2 ≤ v < 6.12.236.13 ≤ v < 6.13.116.13 ≤ v < 6.14.26.13 ≤ v < 6.156.14 ≤ v < 6.14.26.6.64 ≤ v < 6.6.870c8d50501bc13cacecc19caaddc10db372592a393b75f627b73d96787a493e2f1187543ba9c056a46.1.1206.11.116.12.26.136.6.6473c359d1d356cf10236ccd358bd55edab33e94248382e92f90b601acf6d426121e6f4991502e767dd5d83242a1d778ceb6d8b07c6b491cf7483ca112
Vendor states this is fixed in 223d565d8892481684091cfbaf3466f2b0e289d3 (fixed)
Vendor states this is fixed in 60f3caff1492e5b8616b9578c4bedb5c0a88ed14 (fixed)
Vendor states this is fixed in 780628a780b622759d9e5adc76d15432144da1a3 (fixed)
Vendor states this is fixed in 7df2696256a034405d3c5a71b3a4c54725de4404 (fixed)
Vendor states this is fixed in 996e90ab446641553e8e21707b38b9709605e0e0 (fixed)
Affected range stops below 6.12, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 6.12.23 (unaffected)
Vendor states this is fixed in 6.13 (unaffected)
Vendor states this is fixed in 6.13.11 (unaffected)
Vendor states this is fixed in 6.14.2 (unaffected)
Vendor states this is fixed in 6.15 (unaffected)
Affected range stops below 6.2, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 6.6.87 (unaffected)

References (5)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/223d565d8892481684091cfbaf3466f2b0e289d3
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/60f3caff1492e5b8616b9578c4bedb5c0a88ed14
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/780628a780b622759d9e5adc76d15432144da1a3
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/7df2696256a034405d3c5a71b3a4c54725de4404
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/996e90ab446641553e8e21707b38b9709605e0e0

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
NVD-CWE-noinfo

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card