bpf: Hold map BTF for the memory allocator destructor record
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+0x
CVE-2026-98813
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-98813
Linux
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Linux
Source reference: /containers/cna/affected/1/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "1df97a7453eec80c1912c2d0360290a3970a7671",
"lessThan": "b506f5699e145196ee29d76cf1ca1cbb2202c055",
"versionType": "git"
},
{
"status": "affected",
"version": "1df97a7453eec80c1912c2d0360290a3970a7671",
"lessThan": "ab39974240a0cff765f3bb9cce81d8001ffdb144",
"versionType": "git"
},
{
"status": "affected",
"version": "451a84a3ad3c897c03181af433e7c98640730f1f",
"versionType": "git"
},
{
"status": "affected",
"version": "51a17f0ce19c4ee2a25cf16c93490d509b1ebb0a",
"versionType": "git"
},
{
"status": "affected",
"version": "6.12.112",
"lessThan": "6.13",
"versionType": "semver"
},
{
"status": "affected",
"version": "6.18.55",
"lessThan": "6.19",
"versionType": "semver"
}
],
"programFiles": [
"kernel/bpf/hashtab.c"
],
"defaultStatus": "unaffected"
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "7.0"
},
{
"status": "unaffected",
"version": "0",
"lessThan": "7.0",
"versionType": "semver"
},
{
"status": "unaffected",
"version": "7.2.10",
"versionType": "semver",
"lessThanOrEqual": "7.2.*"
},
{
"status": "unaffected",
"version": "7.3",
"versionType": "original_commit_for_fix",
"lessThanOrEqual": "*"
}
],
"programFiles": [
"kernel/bpf/hashtab.c"
],
"defaultStatus": "affected"
}
]- Related CVEs
- CVE-2026-98813
Source reference:
/cveMetadata/cveId
Publisher severity
No explicit severity was provided.
- Event
- #38730 · Revision 1
- Added to Heist Feed
- Publisher date