# CVE-2026-98813: bpf: Hold map BTF for the memory allocator destructor record

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.20% (percentile 5, 2026-11-28)
- **Published:** 2026-10-18T15:48:59.745Z
- **Modified:** 2026-10-19T10:19:45.330Z

## Who should check

- Anyone running Linux \>= 1df97a7453eec80c1912c2d0360290a3970a7671, \< b506f5699e145196ee29d76cf1ca1cbb2202c055; \>= 1df97a7453eec80c1912c2d0360290a3970a7671, \< ab39974240a0cff765f3bb9cce81d8001ffdb144; 451a84a3ad3c897c03181af433e7c98640730f1f; 51a17f0ce19c4ee2a25cf16c93490d509b1ebb0a; \>= 6.12.112, \< 6.13; \>= 6.18.55, \< 6.19
- Anyone running Linux 7.0

## Description

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

bpf: Hold map BTF for the memory allocator destructor record

bpf\_ma\_set\_dtor() duplicates map-\>record so that the bpf\_mem\_alloc
destructor can release the special fields of hash and rhash map elements
once the allocator frees them for good. btf\_record\_dup() only acquires
references on kernel and module BTF. Fields whose types live in the map
BTF keep pointing into it: a kptr to a local type refers to map-\>btf,
and a list\_head or rb\_root field carries a value\_rec owned by the struct
meta table of map-\>btf.

That borrowed state can outlive the map. When RCU callbacks are still in
flight, bpf\_mem\_alloc\_destroy() copies the allocator and defers the final
drain, together with the destructor context, to a workqueue.
bpf\_map\_free() then frees map-\>record and drops the map's BTF reference
as soon as map\_free() returns. Once the program that loaded the BTF is
gone as well, the BTF is freed while the worker still uses the
duplicate. The worker dereferences it through btf\_is\_kernel() and
btf\_find\_struct\_meta() in bpf\_obj\_free\_fields() when destroying elements
that were freed under RCU, and through btf\_is\_kernel() in
btf\_record\_free() when releasing the context itself:

  BUG: KASAN: slab-use-after-free in btf\_is\_kernel+0x19/0x30
  Read of size 1 at addr ffff88811505dce8 by task kworker/u16:2/50
  Workqueue: events\_unbound free\_mem\_alloc\_deferred
  Call Trace:
   btf\_is\_kernel+0x19/0x30
   btf\_record\_free+0xc7/0xf0
   htab\_dtor\_ctx\_free+0x1a/0x30
   free\_mem\_alloc\_no\_barrier+0x39/0x230
   free\_mem\_alloc\_deferred+0x2a/0x40
   process\_scheduled\_works+0x5ce/0x9d0
   worker\_thread+0x42a/0x5e0
   kthread+0x1f5/0x230
   ret\_from\_fork+0x1dd/0x390
   ret\_from\_fork\_asm+0x1a/0x30

  Allocated by task 358:
   \_\_kmalloc\_cache\_noprof+0x287/0x510
   btf\_new\_fd+0xf7/0x3d0
   \_\_sys\_bpf+0x487/0x840

  Freed by task 0:
   kfree+0x186/0x560
   rcu\_core+0x6f6/0xd40

Freeing a map that still holds more elements than the allocator's high
watermark is enough to get there, because the bulk free during teardown
queues the RCU callback that makes bpf\_mem\_alloc\_destroy() defer.
Non-preallocated hash maps and resizable hash maps both register the
destructor and are affected alike.

Keep one reference on the map BTF in the destructor context. Every
non-kernel pointer in the duplicated record is either map-\>btf or memory
owned by it, so a single reference covers kptrs, list heads, and rb
roots, and mirrors what bpf\_map\_meta\_alloc() does for the duplicated
record of an inner map. Release it only after the duplicated record has
been freed: the worker is preemptible and not in an RCU read-side
critical section, so dropping the last reference first would let the
BTF be freed while btf\_record\_free() still reads its fields.

## Affected and fixed versions

- Linux: \>= 1df97a7453eec80c1912c2d0360290a3970a7671, \< b506f5699e145196ee29d76cf1ca1cbb2202c055; \>= 1df97a7453eec80c1912c2d0360290a3970a7671, \< ab39974240a0cff765f3bb9cce81d8001ffdb144; 451a84a3ad3c897c03181af433e7c98640730f1f; 51a17f0ce19c4ee2a25cf16c93490d509b1ebb0a; \>= 6.12.112, \< 6.13; \>= 6.18.55, \< 6.19 (cvelist)
- Linux: 7.0 (cvelist)

## Mitigation

- Upgrade Linux to 6.19 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-98813.md
Affected: Linux >= 1df97a7453eec80c1912c2d0360290a3970a7671, < b506f5699e145196ee29d76cf1ca1cbb2202c055; >= 1df97a7453eec80c1912c2d0360290a3970a7671, < ab39974240a0cff765f3bb9cce81d8001ffdb144; 451a84a3ad3c897c03181af433e7c98640730f1f; 51a17f0ce19c4ee2a25cf16c93490d509b1ebb0a; >= 6.12.112, < 6.13; >= 6.18.55…
Fixed in: Linux 6.13, Linux 6.19

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-98813 being exploited?

There is no confirmed exploitation: CVE-2026-98813 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.20% chance of exploitation in the next 30 days (as of 2026-11-28).

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

It has no CVSS score yet. Unknown.

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

Linux \>= 1df97a7453eec80c1912c2d0360290a3970a7671, \< b506f5699e145196ee29d76cf1ca1cbb2202c055; \>= 1df97a7453eec80c1912c2d0360290a3970a7671, \< ab39974240a0cff765f3bb9cce81d8001ffdb144; 451a84a3ad3c897c03181af433e7c98640730f1f; 51a17f0ce19c4ee2a25cf16c93490d509b1ebb0a; \>= 6.12.112, \< 6.13; \>= 6.18.55, \< 6.19; Linux 7.0.

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

Yes. Fixed in Linux 6.13, Linux 6.19. Upgrade Linux to 6.19 or later.

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

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/b506f5699e145196ee29d76cf1ca1cbb2202c055>
- other: <https://git.kernel.org/stable/c/ab39974240a0cff765f3bb9cce81d8001ffdb144>

## 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-98813>

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