# CVE-2026-142942: bpf: Destroy callee-local dynptrs on subprog return

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **Published:** 2026-12-03T03:26:11.488Z
- **Modified:** 2026-12-03T04:18:35.817Z

> **AI summary (AI-generated, claude-haiku-5-5):** An attacker with local access can use stale dynptr-derived slices that escape a BPF subprogram, letting the verifier accept invalid memory accesses in the Linux kernel BPF verifier.

## Who should check

- Anyone running Linux \>= 308c7a0ae8859b34d9d90a3dff953b2d14242145, \< abf9f320f9d615358a768aa7b238dbedb79f566c; \>= 308c7a0ae8859b34d9d90a3dff953b2d14242145, \< b65cc81792eb07436879d9f0be8ebd18a78fffb4
- Anyone running Linux 7.2

## Description

In the Linux kernel, the following vulnerability has been resolved:

bpf: Destroy callee-local dynptrs on subprog return

A data slice is valid only while the specific dynptr that produced it
remains valid. prepare\_func\_exit() copies a subprogram return value into
the caller and then frees the callee state without applying the normal
destruction semantics to dynptrs in the callee stack.

A callee can therefore derive a slice from a local dynptr, return or spill
the slice into its caller, and then let the dynptr disappear with the
callee frame. The slice retains the id of a dynptr that is no longer in the
verifier state, so the verifier continues to accept accesses through it.

Before the object relationship refactor, bpf\_dynptr\_data() slices from
referenced dynptrs also carried the shared reference id, allowing a later
release to catch some of these escaped slices. The refactor made those
slices precise children of their source dynptr and exposed the missing
teardown as an accepted stale access even after the shared resource is
released.

Add destroy\_dynptrs\_in\_stack\_slots() to apply the existing dynptr teardown
to an inclusive range of stack slots. Reuse it for dynptr initialization,
variable-offset stack writes, and the entire callee stack before freeing
the frame. The teardown rejects losing the last dynptr for a referenced
resource and invalidates the dynptr and all its descendants, including
slices held in the caller. Propagate errors through prepare\_func\_exit().

Reuse the existing teardown API and diagnostic. Update the affected
callback test expectation in this change so the commit remains test-clean.

## Affected and fixed versions

- Linux: \>= 308c7a0ae8859b34d9d90a3dff953b2d14242145, \< abf9f320f9d615358a768aa7b238dbedb79f566c; \>= 308c7a0ae8859b34d9d90a3dff953b2d14242145, \< b65cc81792eb07436879d9f0be8ebd18a78fffb4 (cvelist)
- Linux: 7.2 (cvelist)

## Technologies

Linux kernel

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-142942. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-142942.md
Affected: Linux >= 308c7a0ae8859b34d9d90a3dff953b2d14242145, < abf9f320f9d615358a768aa7b238dbedb79f566c; >= 308c7a0ae8859b34d9d90a3dff953b2d14242145, < b65cc81792eb07436879d9f0be8ebd18a78fffb4; Linux 7.2
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-142942 being exploited?

There is no confirmed exploitation: CVE-2026-142942 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2026-142942?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-142942?

Linux \>= 308c7a0ae8859b34d9d90a3dff953b2d14242145, \< abf9f320f9d615358a768aa7b238dbedb79f566c; \>= 308c7a0ae8859b34d9d90a3dff953b2d14242145, \< b65cc81792eb07436879d9f0be8ebd18a78fffb4; Linux 7.2.

### Is there a fix for CVE-2026-142942?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-142942?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/abf9f320f9d615358a768aa7b238dbedb79f566c>
- other: <https://git.kernel.org/stable/c/b65cc81792eb07436879d9f0be8ebd18a78fffb4>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-142942>

HTML: <https://flawdb.com/CVE-2026-142942> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-142942>
