{"id":"CVE-2026-139296","state":"PUBLISHED","title":"bpf: Keep values of a dead owner for sleepable programs","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Keep values of a dead owner for sleepable programs\n\nbpf_local_storage_destroy() frees the elements of an owner behind a plain\nRCU grace period, on the ground that no program can refer to an owner that\ngoes away.  But the pointer that bpf_task_storage_get() and its like\nreturn stays valid for the verifier after the program has released the\nowner, or has left the bpf_rcu_read_lock() section it had the owner from.\nA sleepable program is in no RCU read side critical section, so it can\nwrite to the value after the owner has died and the element was freed:\n\n  BUG: KASAN: slab-use-after-free in _copy_from_user+0x42/0xa0\n  Write of size 8 at addr ffff8880074404a8 by task lsuaf/55\n\nFree the element behind an RCU Tasks Trace grace period if sleepable code\nmay use the map.  A program that a map is bound to was loaded, and counted\nin map->sleepable_refcnt, before it got a value from the live owner, and\nstays counted until a grace period behind its last run.\n\nA program can also get at a storage map by a lookup in an outer map.  Then\nonly the outer map is counted, its programs can come after the inner map\nwas put into it, and can hold on to the inner map after it was taken out.\nSo note in a map that it has been an inner map, and treat it like one with\nsleepable users from then on.\n\nThe same goes for what the special fields of the value hold.  The page of\na uptr has to stay pinned, and a kptr which the program stores after the\nowner has died has to be released.  Leave the fields, and the smap that it\ntakes to free them, to bpf_selem_free_trace_rcu(), as bpf_selem_unlink()\ndoes.  bpf_local_storage_map_free() waits for that callback, and leaves\nsmap alone if it comes across such an element.\n\nElements of such maps now wait for sleepable programs that are running\nwhen their owner dies.  Other maps are freed as before.","publishedAt":"2026-11-30T13:33:26.602Z","updatedAt":"2026-11-30T13:33:26.602Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"dcf456c9a095a6e71f53d6f6f004133ee851ee70","status":"affected","lessThan":"9f3447b521a77c876b95b7d2edc6073a81d4c1f6","versionType":"git"},{"version":"dcf456c9a095a6e71f53d6f6f004133ee851ee70","status":"affected","lessThan":"f693030a187b56a3946b36521bb90d785f906669","versionType":"git"},{"version":"cf4b46ea392d75cc06800be7397d58d54453c6f3","status":"affected","versionType":"git"},{"version":"d2d2a1b6670bfac94a8b6a1fa9ce8b786cbe972e","status":"affected","versionType":"git"},{"version":"5.17.13","status":"affected","lessThan":"5.18","versionType":"semver"},{"version":"5.18.2","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/bpf_local_storage.c","kernel/bpf/map_in_map.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","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/bpf_local_storage.c","kernel/bpf/map_in_map.c"]}],"references":["https://git.kernel.org/stable/c/9f3447b521a77c876b95b7d2edc6073a81d4c1f6","https://git.kernel.org/stable/c/f693030a187b56a3946b36521bb90d785f906669"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139296.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139296","state":"PUBLISHED","datePublished":"2026-11-30T13:33:26.602Z","dateUpdated":"2026-11-30T13:33:26.602Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.925Z"},"containers":{"cna":{"title":"bpf: Keep values of a dead owner for sleepable programs","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Keep values of a dead owner for sleepable programs\n\nbpf_local_storage_destroy() frees the elements of an owner behind a plain\nRCU grace period, on the ground that no program can refer to an owner that\ngoes away.  But the pointer that bpf_task_storage_get() and its like\nreturn stays valid for the verifier after the program has released the\nowner, or has left the bpf_rcu_read_lock() section it had the owner from.\nA sleepable program is in no RCU read side critical section, so it can\nwrite to the value after the owner has died and the element was freed:\n\n  BUG: KASAN: slab-use-after-free in _copy_from_user+0x42/0xa0\n  Write of size 8 at addr ffff8880074404a8 by task lsuaf/55\n\nFree the element behind an RCU Tasks Trace grace period if sleepable code\nmay use the map.  A program that a map is bound to was loaded, and counted\nin map->sleepable_refcnt, before it got a value from the live owner, and\nstays counted until a grace period behind its last run.\n\nA program can also get at a storage map by a lookup in an outer map.  Then\nonly the outer map is counted, its programs can come after the inner map\nwas put into it, and can hold on to the inner map after it was taken out.\nSo note in a map that it has been an inner map, and treat it like one with\nsleepable users from then on.\n\nThe same goes for what the special fields of the value hold.  The page of\na uptr has to stay pinned, and a kptr which the program stores after the\nowner has died has to be released.  Leave the fields, and the smap that it\ntakes to free them, to bpf_selem_free_trace_rcu(), as bpf_selem_unlink()\ndoes.  bpf_local_storage_map_free() waits for that callback, and leaves\nsmap alone if it comes across such an element.\n\nElements of such maps now wait for sleepable programs that are running\nwhen their owner dies.  Other maps are freed as before."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"dcf456c9a095a6e71f53d6f6f004133ee851ee70","status":"affected","lessThan":"9f3447b521a77c876b95b7d2edc6073a81d4c1f6","versionType":"git"},{"version":"dcf456c9a095a6e71f53d6f6f004133ee851ee70","status":"affected","lessThan":"f693030a187b56a3946b36521bb90d785f906669","versionType":"git"},{"version":"cf4b46ea392d75cc06800be7397d58d54453c6f3","status":"affected","versionType":"git"},{"version":"d2d2a1b6670bfac94a8b6a1fa9ce8b786cbe972e","status":"affected","versionType":"git"},{"version":"5.17.13","status":"affected","lessThan":"5.18","versionType":"semver"},{"version":"5.18.2","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/bpf_local_storage.c","kernel/bpf/map_in_map.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","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/bpf_local_storage.c","kernel/bpf/map_in_map.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/9f3447b521a77c876b95b7d2edc6073a81d4c1f6"},{"url":"https://git.kernel.org/stable/c/f693030a187b56a3946b36521bb90d785f906669"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:26.602Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"7.4-rc1"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.17.13"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.18.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}