{"id":"CVE-2026-74314","state":"PUBLISHED","title":"bpf: Cancel special fields on map value recycle","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Cancel special fields on map value recycle\n\nMap update and delete paths currently call bpf_obj_free_fields() when a\nvalue is being replaced or recycled. That makes field destruction depend\non the context of the update/delete operation. For tracing programs this\ncan include NMI context, where referenced kptr destructors, uptr\nunpinning, and graph root destruction are not generally safe.\n\nIntroduce bpf_obj_cancel_fields() for the reusable-value path. It only\nperforms NMI-safe cleanup for timer, workqueue, and task_work fields.\nFields that need full destruction are left attached to the recycled value\nand are destroyed by the final cleanup path instead.\n\nSwitch array and hashtab update/delete/recycle paths to this cancel\nhelper. Keep bpf_obj_free_fields() for final map destruction and for\nbpf_mem_alloc destructors. Preallocated hashtabs do not have allocator\ndestructors, so teardown continues to walk the normal and extra elements\nand fully destroy their fields.\n\nThis deliberately relaxes the eager-free semantics of map update/delete\nfor special fields. Programs that relied on a recycled map slot becoming\nempty immediately after update/delete were relying on behavior that\ncannot be implemented safely from every BPF execution context without\noffloading arbitrary destructors.\n\nThere is a chance this change breaks programs making assumptions\nregarding the eager freeing of fields. If so, we can relax semantics to\ncancellation only when irqs_disabled() is true in the future. However,\ntheoretically, map values that get reused eagerly already have weaker\nguarantees as parallel users can recreate freed fields before the new\nelement becomes visible again.","publishedAt":"2026-08-15T05:58:12.766Z","updatedAt":"2026-10-16T18:55:32.490Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"14a324f6a67ef6a53e04362a70160a47eb8afffa","status":"affected","lessThan":"9ea734e2cc0143d7429ab7dc0b20c85e5836183c","versionType":"git"},{"version":"14a324f6a67ef6a53e04362a70160a47eb8afffa","status":"affected","lessThan":"a3a81d247651218e47153f2d2afd7aee236726fd","versionType":"git"},{"version":"f0462d38589422bc9e27fd3c6343dfeb6b3db2f9","status":"affected","versionType":"git"},{"version":"5.18.18","status":"affected","lessThan":"5.19","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf.h","kernel/bpf/arraymap.c","kernel/bpf/hashtab.c","kernel/bpf/syscall.c","tools/testing/selftests/bpf/prog_tests/htab_update.c","tools/testing/selftests/bpf/prog_tests/linked_list.c","tools/testing/selftests/bpf/prog_tests/map_kptr.c","tools/testing/selftests/bpf/prog_tests/refcounted_kptr.c","tools/testing/selftests/bpf/progs/htab_update.c","tools/testing/selftests/bpf/progs/linked_list.c","tools/testing/selftests/bpf/progs/refcounted_kptr.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"7.1.5","status":"unaffected","lessThanOrEqual":"7.1.*","versionType":"semver"},{"version":"7.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf.h","kernel/bpf/arraymap.c","kernel/bpf/hashtab.c","kernel/bpf/syscall.c","tools/testing/selftests/bpf/prog_tests/htab_update.c","tools/testing/selftests/bpf/prog_tests/linked_list.c","tools/testing/selftests/bpf/prog_tests/map_kptr.c","tools/testing/selftests/bpf/prog_tests/refcounted_kptr.c","tools/testing/selftests/bpf/progs/htab_update.c","tools/testing/selftests/bpf/progs/linked_list.c","tools/testing/selftests/bpf/progs/refcounted_kptr.c"]}],"references":["https://git.kernel.org/stable/c/9ea734e2cc0143d7429ab7dc0b20c85e5836183c","https://git.kernel.org/stable/c/a3a81d247651218e47153f2d2afd7aee236726fd"],"weaknesses":[],"ingestedAt":"2026-10-29T20:12:58.252Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/74xxx/CVE-2026-74314.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-74314","state":"PUBLISHED","datePublished":"2026-08-15T05:58:12.766Z","dateUpdated":"2026-10-16T18:55:32.490Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-08-15T05:44:03.883Z"},"containers":{"cna":{"title":"bpf: Cancel special fields on map value recycle","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Cancel special fields on map value recycle\n\nMap update and delete paths currently call bpf_obj_free_fields() when a\nvalue is being replaced or recycled. That makes field destruction depend\non the context of the update/delete operation. For tracing programs this\ncan include NMI context, where referenced kptr destructors, uptr\nunpinning, and graph root destruction are not generally safe.\n\nIntroduce bpf_obj_cancel_fields() for the reusable-value path. It only\nperforms NMI-safe cleanup for timer, workqueue, and task_work fields.\nFields that need full destruction are left attached to the recycled value\nand are destroyed by the final cleanup path instead.\n\nSwitch array and hashtab update/delete/recycle paths to this cancel\nhelper. Keep bpf_obj_free_fields() for final map destruction and for\nbpf_mem_alloc destructors. Preallocated hashtabs do not have allocator\ndestructors, so teardown continues to walk the normal and extra elements\nand fully destroy their fields.\n\nThis deliberately relaxes the eager-free semantics of map update/delete\nfor special fields. Programs that relied on a recycled map slot becoming\nempty immediately after update/delete were relying on behavior that\ncannot be implemented safely from every BPF execution context without\noffloading arbitrary destructors.\n\nThere is a chance this change breaks programs making assumptions\nregarding the eager freeing of fields. If so, we can relax semantics to\ncancellation only when irqs_disabled() is true in the future. However,\ntheoretically, map values that get reused eagerly already have weaker\nguarantees as parallel users can recreate freed fields before the new\nelement becomes visible again."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"14a324f6a67ef6a53e04362a70160a47eb8afffa","status":"affected","lessThan":"9ea734e2cc0143d7429ab7dc0b20c85e5836183c","versionType":"git"},{"version":"14a324f6a67ef6a53e04362a70160a47eb8afffa","status":"affected","lessThan":"a3a81d247651218e47153f2d2afd7aee236726fd","versionType":"git"},{"version":"f0462d38589422bc9e27fd3c6343dfeb6b3db2f9","status":"affected","versionType":"git"},{"version":"5.18.18","status":"affected","lessThan":"5.19","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf.h","kernel/bpf/arraymap.c","kernel/bpf/hashtab.c","kernel/bpf/syscall.c","tools/testing/selftests/bpf/prog_tests/htab_update.c","tools/testing/selftests/bpf/prog_tests/linked_list.c","tools/testing/selftests/bpf/prog_tests/map_kptr.c","tools/testing/selftests/bpf/prog_tests/refcounted_kptr.c","tools/testing/selftests/bpf/progs/htab_update.c","tools/testing/selftests/bpf/progs/linked_list.c","tools/testing/selftests/bpf/progs/refcounted_kptr.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"7.1.5","status":"unaffected","lessThanOrEqual":"7.1.*","versionType":"semver"},{"version":"7.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf.h","kernel/bpf/arraymap.c","kernel/bpf/hashtab.c","kernel/bpf/syscall.c","tools/testing/selftests/bpf/prog_tests/htab_update.c","tools/testing/selftests/bpf/prog_tests/linked_list.c","tools/testing/selftests/bpf/prog_tests/map_kptr.c","tools/testing/selftests/bpf/prog_tests/refcounted_kptr.c","tools/testing/selftests/bpf/progs/htab_update.c","tools/testing/selftests/bpf/progs/linked_list.c","tools/testing/selftests/bpf/progs/refcounted_kptr.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/9ea734e2cc0143d7429ab7dc0b20c85e5836183c"},{"url":"https://git.kernel.org/stable/c/a3a81d247651218e47153f2d2afd7aee236726fd"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The bug is reached via bpf_map_update_elem/delete_elem on BPF array/hash maps, callable from the bpf() syscall and from in-kernel BPF helpers when tracing or perf BPF programs run; per kernel guidance BPF is a Local attack vector, not network-reachable.\nAC:L - An attacker who can load and attach BPF programs controls the map contents, update/delete timing, and trace/perf attach points (including NMI-capable hooks), so the unsafe bpf_obj_free_fields() recycle path is triggerable without luck or victim-specific state.\nPR:L - Exploitation requires loading tracing/perf BPF programs with BTF maps holding kptr/list/uptr fields (CAP_BPF plus CAP_PERFMON), which bpf_token_capable() grants to user-namespace CAP_SYS_ADMIN holders (e.g. unshare -Urn) and delegated BPF token users, not only init-namespace root.\nUI:N - No victim interaction is required; the attacker triggers map recycle from their own loaded BPF program or concurrent bpf() map operations during tracing/perf events they control.\nS:U - Impact stays within kernel memory and privilege boundaries (deadlock, oops, memory corruption, potential local privilege escalation) and does not cross VM, container, or IOMMU security scopes on its own.\nC:H - Recycling map values from NMI/atomic tracing context runs bpf_obj_free_fields() kptr destructors, uptr unpinning, and graph teardown unsafely, enabling use-after-free and inconsistent object lifetimes that can be turned into arbitrary kernel memory disclosure.\nI:H - The same unsafe recycle path performs non-NMI-safe kptr destructor calls, recursive __bpf_obj_drop_impl() graph freeing, and uptr unpinning from wrong context, giving plausible heap corruption and control-flow hijack primitives beyond a simple crash.\nA:H - Calling bpf_obj_free_fields() from NMI/tracing contexts can deadlock on BPF/hash locks (documented IN-NMI lockdep failures in related BPF LRU fixes) or panic/oops via illegal page unpinning and destructor execution, fully denying kernel availability."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-17T05:45:47.130Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"7.1.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"7.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18.18"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2026-74314","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-10-16T18:53:09.033904Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-16T18:55:32.490Z"}}]}}}