{"id":"CVE-2026-139311","state":"PUBLISHED","title":"bpf: Link the first element after its storage is published","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Link the first element after its storage is published\n\nbpf_local_storage_alloc() links the first element of a new storage to the\nbucket of its map, and then publishes the storage in the owner with\ncmpxchg().  If another cpu has been faster, the element is taken out of\nthe bucket again and is freed together with the storage.\n\nIn between the iterator over a sk_storage map can find the element.  It\nstays linked to a storage that points to the socket, but the socket knows\nnothing of that storage: bpf_sk_storage_free() neither unlinks the element\nnor waits for anybody who uses the storage.  So nothing tells the iterator\nthat the socket has gone away.\n\nThree cpus that create the first storage of a new AF_UNIX socket at the\nsame time, and a fourth that reads the iterator, are enough: in 20 seconds\nits program was shown some 4000 elements of storages that had lost.  If the\nsocket is closed in time, the program is handed a freed socket.\n\nLink the element once the storage is published.  Both happens under the\nlock of the bucket, which holds off whoever finds the element through the\nowner and wants to unlink it.","publishedAt":"2026-11-30T13:33:34.870Z","updatedAt":"2026-11-30T13:33:34.870Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c69d2ddb2072eb7ffca1a31ee5ddc16dcd414ed9","status":"affected","lessThan":"d85ea0db86bc00d392be347799d7027090cc5929","versionType":"git"},{"version":"c69d2ddb2072eb7ffca1a31ee5ddc16dcd414ed9","status":"affected","lessThan":"bd897919e4dc18bbfdfc58b696fb948b8bc2c79a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/bpf_local_storage.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.10","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":["kernel/bpf/bpf_local_storage.c"]}],"references":["https://git.kernel.org/stable/c/d85ea0db86bc00d392be347799d7027090cc5929","https://git.kernel.org/stable/c/bd897919e4dc18bbfdfc58b696fb948b8bc2c79a"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139311.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139311","state":"PUBLISHED","datePublished":"2026-11-30T13:33:34.870Z","dateUpdated":"2026-11-30T13:33:34.870Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.926Z"},"containers":{"cna":{"title":"bpf: Link the first element after its storage is published","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Link the first element after its storage is published\n\nbpf_local_storage_alloc() links the first element of a new storage to the\nbucket of its map, and then publishes the storage in the owner with\ncmpxchg().  If another cpu has been faster, the element is taken out of\nthe bucket again and is freed together with the storage.\n\nIn between the iterator over a sk_storage map can find the element.  It\nstays linked to a storage that points to the socket, but the socket knows\nnothing of that storage: bpf_sk_storage_free() neither unlinks the element\nnor waits for anybody who uses the storage.  So nothing tells the iterator\nthat the socket has gone away.\n\nThree cpus that create the first storage of a new AF_UNIX socket at the\nsame time, and a fourth that reads the iterator, are enough: in 20 seconds\nits program was shown some 4000 elements of storages that had lost.  If the\nsocket is closed in time, the program is handed a freed socket.\n\nLink the element once the storage is published.  Both happens under the\nlock of the bucket, which holds off whoever finds the element through the\nowner and wants to unlink it."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c69d2ddb2072eb7ffca1a31ee5ddc16dcd414ed9","status":"affected","lessThan":"d85ea0db86bc00d392be347799d7027090cc5929","versionType":"git"},{"version":"c69d2ddb2072eb7ffca1a31ee5ddc16dcd414ed9","status":"affected","lessThan":"bd897919e4dc18bbfdfc58b696fb948b8bc2c79a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/bpf_local_storage.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.10","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":["kernel/bpf/bpf_local_storage.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/d85ea0db86bc00d392be347799d7027090cc5929"},{"url":"https://git.kernel.org/stable/c/bd897919e4dc18bbfdfc58b696fb948b8bc2c79a"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:34.870Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}