{"api_version":"1","generated_at":"2026-10-22T10:32:34+00:00","cve":"CVE-2026-98813","urls":{"html":"https://cve.report/CVE-2026-98813","api":"https://cve.report/api/cve/CVE-2026-98813.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-98813","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-98813"},"summary":{"title":"bpf: Hold map BTF for the memory allocator destructor record","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Hold map BTF for the memory allocator destructor record\n\nbpf_ma_set_dtor() duplicates map->record so that the bpf_mem_alloc\ndestructor can release the special fields of hash and rhash map elements\nonce the allocator frees them for good. btf_record_dup() only acquires\nreferences on kernel and module BTF. Fields whose types live in the map\nBTF keep pointing into it: a kptr to a local type refers to map->btf,\nand a list_head or rb_root field carries a value_rec owned by the struct\nmeta table of map->btf.\n\nThat borrowed state can outlive the map. When RCU callbacks are still in\nflight, bpf_mem_alloc_destroy() copies the allocator and defers the final\ndrain, together with the destructor context, to a workqueue.\nbpf_map_free() then frees map->record and drops the map's BTF reference\nas soon as map_free() returns. Once the program that loaded the BTF is\ngone as well, the BTF is freed while the worker still uses the\nduplicate. The worker dereferences it through btf_is_kernel() and\nbtf_find_struct_meta() in bpf_obj_free_fields() when destroying elements\nthat were freed under RCU, and through btf_is_kernel() in\nbtf_record_free() when releasing the context itself:\n\n  BUG: KASAN: slab-use-after-free in btf_is_kernel+0x19/0x30\n  Read of size 1 at addr ffff88811505dce8 by task kworker/u16:2/50\n  Workqueue: events_unbound free_mem_alloc_deferred\n  Call Trace:\n   btf_is_kernel+0x19/0x30\n   btf_record_free+0xc7/0xf0\n   htab_dtor_ctx_free+0x1a/0x30\n   free_mem_alloc_no_barrier+0x39/0x230\n   free_mem_alloc_deferred+0x2a/0x40\n   process_scheduled_works+0x5ce/0x9d0\n   worker_thread+0x42a/0x5e0\n   kthread+0x1f5/0x230\n   ret_from_fork+0x1dd/0x390\n   ret_from_fork_asm+0x1a/0x30\n\n  Allocated by task 358:\n   __kmalloc_cache_noprof+0x287/0x510\n   btf_new_fd+0xf7/0x3d0\n   __sys_bpf+0x487/0x840\n\n  Freed by task 0:\n   kfree+0x186/0x560\n   rcu_core+0x6f6/0xd40\n\nFreeing a map that still holds more elements than the allocator's high\nwatermark is enough to get there, because the bulk free during teardown\nqueues the RCU callback that makes bpf_mem_alloc_destroy() defer.\nNon-preallocated hash maps and resizable hash maps both register the\ndestructor and are affected alike.\n\nKeep one reference on the map BTF in the destructor context. Every\nnon-kernel pointer in the duplicated record is either map->btf or memory\nowned by it, so a single reference covers kptrs, list heads, and rb\nroots, and mirrors what bpf_map_meta_alloc() does for the duplicated\nrecord of an inner map. Release it only after the duplicated record has\nbeen freed: the worker is preemptible and not in an RCU read-side\ncritical section, so dropping the last reference first would let the\nBTF be freed while btf_record_free() still reads its fields.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-10-18 16:17:35","updated_at":"2026-10-19 10:19:45"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/b506f5699e145196ee29d76cf1ca1cbb2202c055","name":"https://git.kernel.org/stable/c/b506f5699e145196ee29d76cf1ca1cbb2202c055","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/ab39974240a0cff765f3bb9cce81d8001ffdb144","name":"https://git.kernel.org/stable/c/ab39974240a0cff765f3bb9cce81d8001ffdb144","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-98813","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98813","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 1df97a7453eec80c1912c2d0360290a3970a7671 b506f5699e145196ee29d76cf1ca1cbb2202c055 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 1df97a7453eec80c1912c2d0360290a3970a7671 ab39974240a0cff765f3bb9cce81d8001ffdb144 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 451a84a3ad3c897c03181af433e7c98640730f1f git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 51a17f0ce19c4ee2a25cf16c93490d509b1ebb0a git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.12.112 6.13 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.18.55 6.19 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 7.0","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.0 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2.10 7.2.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["kernel/bpf/hashtab.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"b506f5699e145196ee29d76cf1ca1cbb2202c055","status":"affected","version":"1df97a7453eec80c1912c2d0360290a3970a7671","versionType":"git"},{"lessThan":"ab39974240a0cff765f3bb9cce81d8001ffdb144","status":"affected","version":"1df97a7453eec80c1912c2d0360290a3970a7671","versionType":"git"},{"status":"affected","version":"451a84a3ad3c897c03181af433e7c98640730f1f","versionType":"git"},{"status":"affected","version":"51a17f0ce19c4ee2a25cf16c93490d509b1ebb0a","versionType":"git"},{"lessThan":"6.13","status":"affected","version":"6.12.112","versionType":"semver"},{"lessThan":"6.19","status":"affected","version":"6.18.55","versionType":"semver"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["kernel/bpf/hashtab.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"7.0"},{"lessThan":"7.0","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"7.2.*","status":"unaffected","version":"7.2.10","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.3","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.2.10","versionStartIncluding":"7.0","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3","versionStartIncluding":"7.0","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12.112","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18.55","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Hold map BTF for the memory allocator destructor record\n\nbpf_ma_set_dtor() duplicates map->record so that the bpf_mem_alloc\ndestructor can release the special fields of hash and rhash map elements\nonce the allocator frees them for good. btf_record_dup() only acquires\nreferences on kernel and module BTF. Fields whose types live in the map\nBTF keep pointing into it: a kptr to a local type refers to map->btf,\nand a list_head or rb_root field carries a value_rec owned by the struct\nmeta table of map->btf.\n\nThat borrowed state can outlive the map. When RCU callbacks are still in\nflight, bpf_mem_alloc_destroy() copies the allocator and defers the final\ndrain, together with the destructor context, to a workqueue.\nbpf_map_free() then frees map->record and drops the map's BTF reference\nas soon as map_free() returns. Once the program that loaded the BTF is\ngone as well, the BTF is freed while the worker still uses the\nduplicate. The worker dereferences it through btf_is_kernel() and\nbtf_find_struct_meta() in bpf_obj_free_fields() when destroying elements\nthat were freed under RCU, and through btf_is_kernel() in\nbtf_record_free() when releasing the context itself:\n\n  BUG: KASAN: slab-use-after-free in btf_is_kernel+0x19/0x30\n  Read of size 1 at addr ffff88811505dce8 by task kworker/u16:2/50\n  Workqueue: events_unbound free_mem_alloc_deferred\n  Call Trace:\n   btf_is_kernel+0x19/0x30\n   btf_record_free+0xc7/0xf0\n   htab_dtor_ctx_free+0x1a/0x30\n   free_mem_alloc_no_barrier+0x39/0x230\n   free_mem_alloc_deferred+0x2a/0x40\n   process_scheduled_works+0x5ce/0x9d0\n   worker_thread+0x42a/0x5e0\n   kthread+0x1f5/0x230\n   ret_from_fork+0x1dd/0x390\n   ret_from_fork_asm+0x1a/0x30\n\n  Allocated by task 358:\n   __kmalloc_cache_noprof+0x287/0x510\n   btf_new_fd+0xf7/0x3d0\n   __sys_bpf+0x487/0x840\n\n  Freed by task 0:\n   kfree+0x186/0x560\n   rcu_core+0x6f6/0xd40\n\nFreeing a map that still holds more elements than the allocator's high\nwatermark is enough to get there, because the bulk free during teardown\nqueues the RCU callback that makes bpf_mem_alloc_destroy() defer.\nNon-preallocated hash maps and resizable hash maps both register the\ndestructor and are affected alike.\n\nKeep one reference on the map BTF in the destructor context. Every\nnon-kernel pointer in the duplicated record is either map->btf or memory\nowned by it, so a single reference covers kptrs, list heads, and rb\nroots, and mirrors what bpf_map_meta_alloc() does for the duplicated\nrecord of an inner map. Release it only after the duplicated record has\nbeen freed: the worker is preemptible and not in an RCU read-side\ncritical section, so dropping the last reference first would let the\nBTF be freed while btf_record_free() still reads its fields."}],"providerMetadata":{"dateUpdated":"2026-10-19T09:26:06.490Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/b506f5699e145196ee29d76cf1ca1cbb2202c055"},{"url":"https://git.kernel.org/stable/c/ab39974240a0cff765f3bb9cce81d8001ffdb144"}],"title":"bpf: Hold map BTF for the memory allocator destructor record","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-98813","datePublished":"2026-10-18T15:48:59.745Z","dateReserved":"2026-09-25T10:25:14.371Z","dateUpdated":"2026-10-19T09:26:06.490Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-10-18 16:17:35","lastModifiedDate":"2026-10-19 10:19:45","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"98813","Ordinal":"1","Title":"bpf: Hold map BTF for the memory allocator destructor record","CVE":"CVE-2026-98813","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"98813","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Hold map BTF for the memory allocator destructor record\n\nbpf_ma_set_dtor() duplicates map->record so that the bpf_mem_alloc\ndestructor can release the special fields of hash and rhash map elements\nonce the allocator frees them for good. btf_record_dup() only acquires\nreferences on kernel and module BTF. Fields whose types live in the map\nBTF keep pointing into it: a kptr to a local type refers to map->btf,\nand a list_head or rb_root field carries a value_rec owned by the struct\nmeta table of map->btf.\n\nThat borrowed state can outlive the map. When RCU callbacks are still in\nflight, bpf_mem_alloc_destroy() copies the allocator and defers the final\ndrain, together with the destructor context, to a workqueue.\nbpf_map_free() then frees map->record and drops the map's BTF reference\nas soon as map_free() returns. Once the program that loaded the BTF is\ngone as well, the BTF is freed while the worker still uses the\nduplicate. The worker dereferences it through btf_is_kernel() and\nbtf_find_struct_meta() in bpf_obj_free_fields() when destroying elements\nthat were freed under RCU, and through btf_is_kernel() in\nbtf_record_free() when releasing the context itself:\n\n  BUG: KASAN: slab-use-after-free in btf_is_kernel+0x19/0x30\n  Read of size 1 at addr ffff88811505dce8 by task kworker/u16:2/50\n  Workqueue: events_unbound free_mem_alloc_deferred\n  Call Trace:\n   btf_is_kernel+0x19/0x30\n   btf_record_free+0xc7/0xf0\n   htab_dtor_ctx_free+0x1a/0x30\n   free_mem_alloc_no_barrier+0x39/0x230\n   free_mem_alloc_deferred+0x2a/0x40\n   process_scheduled_works+0x5ce/0x9d0\n   worker_thread+0x42a/0x5e0\n   kthread+0x1f5/0x230\n   ret_from_fork+0x1dd/0x390\n   ret_from_fork_asm+0x1a/0x30\n\n  Allocated by task 358:\n   __kmalloc_cache_noprof+0x287/0x510\n   btf_new_fd+0xf7/0x3d0\n   __sys_bpf+0x487/0x840\n\n  Freed by task 0:\n   kfree+0x186/0x560\n   rcu_core+0x6f6/0xd40\n\nFreeing a map that still holds more elements than the allocator's high\nwatermark is enough to get there, because the bulk free during teardown\nqueues the RCU callback that makes bpf_mem_alloc_destroy() defer.\nNon-preallocated hash maps and resizable hash maps both register the\ndestructor and are affected alike.\n\nKeep one reference on the map BTF in the destructor context. Every\nnon-kernel pointer in the duplicated record is either map->btf or memory\nowned by it, so a single reference covers kptrs, list heads, and rb\nroots, and mirrors what bpf_map_meta_alloc() does for the duplicated\nrecord of an inner map. Release it only after the duplicated record has\nbeen freed: the worker is preemptible and not in an RCU read-side\ncritical section, so dropping the last reference first would let the\nBTF be freed while btf_record_free() still reads its fields.","Type":"Description","Title":"bpf: Hold map BTF for the memory allocator destructor record"}]}}}