{"id":"CVE-2026-139317","state":"PUBLISHED","title":"bpf: Don't saturate owner_refcnt on the last unpin","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Don't saturate owner_refcnt on the last unpin\n\nbpf_local_storage_map_free() pins the owner with refcount_inc_not_zero()\nwhile it uncharges an element.  The pin counts when\nbpf_local_storage_destroy() could not get local_storage->lock: destroy()\nthen goes on, drops the owner's reference and spins until the count is\nzero.  So the pin is the last reference whenever it is needed, and\nrefcount_dec() takes that for a bug: it warns \"decrement hit 0; leaking\nmemory\" and saturates the count.  Unless destroy() happens to read the\ncount between the two stores it spins for ever, under rcu_read_lock().\n\nDrop the pin with refcount_dec_and_test().","publishedAt":"2026-11-30T13:33:38.718Z","updatedAt":"2026-11-30T13:33:38.718Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5d800f87d0a5ea1b156c47a4b9fd128479335153","status":"affected","lessThan":"f2c55a9b936da22525988d9040f528d6feb78359","versionType":"git"},{"version":"5d800f87d0a5ea1b156c47a4b9fd128479335153","status":"affected","lessThan":"30a140c9d479974021f5c3eecb64415c96419c3f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf_local_storage.h","kernel/bpf/bpf_local_storage.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.0","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_local_storage.h","kernel/bpf/bpf_local_storage.c"]}],"references":["https://git.kernel.org/stable/c/f2c55a9b936da22525988d9040f528d6feb78359","https://git.kernel.org/stable/c/30a140c9d479974021f5c3eecb64415c96419c3f"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139317.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139317","state":"PUBLISHED","datePublished":"2026-11-30T13:33:38.718Z","dateUpdated":"2026-11-30T13:33:38.718Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.926Z"},"containers":{"cna":{"title":"bpf: Don't saturate owner_refcnt on the last unpin","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Don't saturate owner_refcnt on the last unpin\n\nbpf_local_storage_map_free() pins the owner with refcount_inc_not_zero()\nwhile it uncharges an element.  The pin counts when\nbpf_local_storage_destroy() could not get local_storage->lock: destroy()\nthen goes on, drops the owner's reference and spins until the count is\nzero.  So the pin is the last reference whenever it is needed, and\nrefcount_dec() takes that for a bug: it warns \"decrement hit 0; leaking\nmemory\" and saturates the count.  Unless destroy() happens to read the\ncount between the two stores it spins for ever, under rcu_read_lock().\n\nDrop the pin with refcount_dec_and_test()."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5d800f87d0a5ea1b156c47a4b9fd128479335153","status":"affected","lessThan":"f2c55a9b936da22525988d9040f528d6feb78359","versionType":"git"},{"version":"5d800f87d0a5ea1b156c47a4b9fd128479335153","status":"affected","lessThan":"30a140c9d479974021f5c3eecb64415c96419c3f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf_local_storage.h","kernel/bpf/bpf_local_storage.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"7.0","status":"affected"},{"version":"0","status":"unaffected","lessThan":"7.0","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_local_storage.h","kernel/bpf/bpf_local_storage.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/f2c55a9b936da22525988d9040f528d6feb78359"},{"url":"https://git.kernel.org/stable/c/30a140c9d479974021f5c3eecb64415c96419c3f"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:38.718Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.0","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.0","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}