{"id":"CVE-2026-139306","state":"PUBLISHED","title":"bpf: Keep a program until its bpf_wq callback has ended","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Keep a program until its bpf_wq callback has ended\n\nbpf_wq_work() runs the callback under rcu_read_lock_trace() only, since\nthe callback may sleep.  The program it belongs to need not be sleepable,\nand such a program is freed behind a plain RCU grace period.  The\nreference that the bpf_wq holds is dropped when the map element goes, or\nwhen another callback is set, no matter whether the work is running.\n\nIf that was the last reference the program is freed under the running\ncallback, and the worker goes on in the freed JIT image:\n\n  Oops: int3: 0000 [#1] SMP NOPTI\n  RIP: 0010:0xffffffffc0600947\n\nAll it takes is to close the map and the program while the callback runs.\n\nNote in the program that it has a callback that runs sleepable, and wait\nfor an RCU Tasks Trace grace period, which implies a plain one, before\nsuch a program is freed.  Let bpf_wq_work() enter its read side critical\nsection before it reads callback_fn.\n\nbpf_task_work holds a reference to the program until the callback is done.","publishedAt":"2026-11-30T13:33:32.133Z","updatedAt":"2026-11-30T13:33:32.133Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8e83da9732d91c60fdc651b2486c8e5935eb0ca2","status":"affected","lessThan":"a273301da9a0d8fed2a89b11cbc488b5675e391e","versionType":"git"},{"version":"8e83da9732d91c60fdc651b2486c8e5935eb0ca2","status":"affected","lessThan":"20a0245bc0b28cdf471be673015bd7192eb41244","versionType":"git"},{"version":"8e83da9732d91c60fdc651b2486c8e5935eb0ca2","status":"affected","lessThan":"4717886c2169bb4af1b29f2dbdb80a9aa66ace97","versionType":"git"},{"version":"8e83da9732d91c60fdc651b2486c8e5935eb0ca2","status":"affected","lessThan":"1e28a5e52d32b7d3f4c9fb24898774f941166d2b","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf.h","kernel/bpf/helpers.c","kernel/bpf/syscall.c","kernel/bpf/verifier.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","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/helpers.c","kernel/bpf/syscall.c","kernel/bpf/verifier.c"]}],"references":["https://git.kernel.org/stable/c/a273301da9a0d8fed2a89b11cbc488b5675e391e","https://git.kernel.org/stable/c/20a0245bc0b28cdf471be673015bd7192eb41244","https://git.kernel.org/stable/c/4717886c2169bb4af1b29f2dbdb80a9aa66ace97","https://git.kernel.org/stable/c/1e28a5e52d32b7d3f4c9fb24898774f941166d2b"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139306.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139306","state":"PUBLISHED","datePublished":"2026-11-30T13:33:32.133Z","dateUpdated":"2026-11-30T13:33:32.133Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.926Z"},"containers":{"cna":{"title":"bpf: Keep a program until its bpf_wq callback has ended","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Keep a program until its bpf_wq callback has ended\n\nbpf_wq_work() runs the callback under rcu_read_lock_trace() only, since\nthe callback may sleep.  The program it belongs to need not be sleepable,\nand such a program is freed behind a plain RCU grace period.  The\nreference that the bpf_wq holds is dropped when the map element goes, or\nwhen another callback is set, no matter whether the work is running.\n\nIf that was the last reference the program is freed under the running\ncallback, and the worker goes on in the freed JIT image:\n\n  Oops: int3: 0000 [#1] SMP NOPTI\n  RIP: 0010:0xffffffffc0600947\n\nAll it takes is to close the map and the program while the callback runs.\n\nNote in the program that it has a callback that runs sleepable, and wait\nfor an RCU Tasks Trace grace period, which implies a plain one, before\nsuch a program is freed.  Let bpf_wq_work() enter its read side critical\nsection before it reads callback_fn.\n\nbpf_task_work holds a reference to the program until the callback is done."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8e83da9732d91c60fdc651b2486c8e5935eb0ca2","status":"affected","lessThan":"a273301da9a0d8fed2a89b11cbc488b5675e391e","versionType":"git"},{"version":"8e83da9732d91c60fdc651b2486c8e5935eb0ca2","status":"affected","lessThan":"20a0245bc0b28cdf471be673015bd7192eb41244","versionType":"git"},{"version":"8e83da9732d91c60fdc651b2486c8e5935eb0ca2","status":"affected","lessThan":"4717886c2169bb4af1b29f2dbdb80a9aa66ace97","versionType":"git"},{"version":"8e83da9732d91c60fdc651b2486c8e5935eb0ca2","status":"affected","lessThan":"1e28a5e52d32b7d3f4c9fb24898774f941166d2b","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf.h","kernel/bpf/helpers.c","kernel/bpf/syscall.c","kernel/bpf/verifier.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.10","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","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/helpers.c","kernel/bpf/syscall.c","kernel/bpf/verifier.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/a273301da9a0d8fed2a89b11cbc488b5675e391e"},{"url":"https://git.kernel.org/stable/c/20a0245bc0b28cdf471be673015bd7192eb41244"},{"url":"https://git.kernel.org/stable/c/4717886c2169bb4af1b29f2dbdb80a9aa66ace97"},{"url":"https://git.kernel.org/stable/c/1e28a5e52d32b7d3f4c9fb24898774f941166d2b"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:32.133Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}