{"id":"CVE-2026-139302","state":"PUBLISHED","title":"bpf: Don't take an extension for an iterator program","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Don't take an extension for an iterator program\n\nAn extension inherits the expected_attach_type of the program it extends.\nIf that is BPF_TRACE_ITER, check_attach_btf_id() hands the extension to\nbpf_iter_prog_supported(), which goes by the name of the attach function.\nFor an extension that is the name of the subprogram it replaces, so the\nload fails with -EINVAL, unless that subprogram is called like the function\nof a target, bpf_iter_bpf_map_elem for example.\n\nThen the extension gets the context of that target.  If the subprogram\nhas as many arguments, it can use the key and the value as buffers, but\nhow far it reaches is noted in the extension, where the test of the\niterator link does not look: it reads and writes behind the elements of\nthe map.  And the id of the subprogram in the BTF of the program is cached\nas the id of the target, so that programs of that target which are loaded\nalready cannot be attached.\n\nRefuse all extensions here.","publishedAt":"2026-11-30T13:33:29.946Z","updatedAt":"2026-11-30T13:33:29.946Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"46a8a2acca26616f8445af133f32d7740332fdc0","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"afd54a08a29406fb3d8ea8e828bdb5d1e4862088","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"e8b7f9151e465c4ab5e712f84041b0cf3b90425b","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"d7a76b9b807349c3057beccd574fcd0aec2c773b","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"061c4649fa49ed80e3f3ac872665230cb6fa898c","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"1b79f322cbfb59d920b102a18efdd14f17e3d5ad","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"b741414a94a7196454456ea46e5e08798e98d252","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"7cc639dc45c5d3b69acb2a2fc834e9eec51e0214","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/bpf_iter.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","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":["kernel/bpf/bpf_iter.c"]}],"references":["https://git.kernel.org/stable/c/46a8a2acca26616f8445af133f32d7740332fdc0","https://git.kernel.org/stable/c/afd54a08a29406fb3d8ea8e828bdb5d1e4862088","https://git.kernel.org/stable/c/e8b7f9151e465c4ab5e712f84041b0cf3b90425b","https://git.kernel.org/stable/c/d7a76b9b807349c3057beccd574fcd0aec2c773b","https://git.kernel.org/stable/c/061c4649fa49ed80e3f3ac872665230cb6fa898c","https://git.kernel.org/stable/c/1b79f322cbfb59d920b102a18efdd14f17e3d5ad","https://git.kernel.org/stable/c/b741414a94a7196454456ea46e5e08798e98d252","https://git.kernel.org/stable/c/7cc639dc45c5d3b69acb2a2fc834e9eec51e0214"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139302.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139302","state":"PUBLISHED","datePublished":"2026-11-30T13:33:29.946Z","dateUpdated":"2026-11-30T13:33:29.946Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.925Z"},"containers":{"cna":{"title":"bpf: Don't take an extension for an iterator program","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Don't take an extension for an iterator program\n\nAn extension inherits the expected_attach_type of the program it extends.\nIf that is BPF_TRACE_ITER, check_attach_btf_id() hands the extension to\nbpf_iter_prog_supported(), which goes by the name of the attach function.\nFor an extension that is the name of the subprogram it replaces, so the\nload fails with -EINVAL, unless that subprogram is called like the function\nof a target, bpf_iter_bpf_map_elem for example.\n\nThen the extension gets the context of that target.  If the subprogram\nhas as many arguments, it can use the key and the value as buffers, but\nhow far it reaches is noted in the extension, where the test of the\niterator link does not look: it reads and writes behind the elements of\nthe map.  And the id of the subprogram in the BTF of the program is cached\nas the id of the target, so that programs of that target which are loaded\nalready cannot be attached.\n\nRefuse all extensions here."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"46a8a2acca26616f8445af133f32d7740332fdc0","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"afd54a08a29406fb3d8ea8e828bdb5d1e4862088","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"e8b7f9151e465c4ab5e712f84041b0cf3b90425b","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"d7a76b9b807349c3057beccd574fcd0aec2c773b","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"061c4649fa49ed80e3f3ac872665230cb6fa898c","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"1b79f322cbfb59d920b102a18efdd14f17e3d5ad","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"b741414a94a7196454456ea46e5e08798e98d252","versionType":"git"},{"version":"15d83c4d7cef5c067a8b075ce59e97df4f60706e","status":"affected","lessThan":"7cc639dc45c5d3b69acb2a2fc834e9eec51e0214","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/bpf_iter.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"5.10.275","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.226","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.193","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","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":["kernel/bpf/bpf_iter.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/46a8a2acca26616f8445af133f32d7740332fdc0"},{"url":"https://git.kernel.org/stable/c/afd54a08a29406fb3d8ea8e828bdb5d1e4862088"},{"url":"https://git.kernel.org/stable/c/e8b7f9151e465c4ab5e712f84041b0cf3b90425b"},{"url":"https://git.kernel.org/stable/c/d7a76b9b807349c3057beccd574fcd0aec2c773b"},{"url":"https://git.kernel.org/stable/c/061c4649fa49ed80e3f3ac872665230cb6fa898c"},{"url":"https://git.kernel.org/stable/c/1b79f322cbfb59d920b102a18efdd14f17e3d5ad"},{"url":"https://git.kernel.org/stable/c/b741414a94a7196454456ea46e5e08798e98d252"},{"url":"https://git.kernel.org/stable/c/7cc639dc45c5d3b69acb2a2fc834e9eec51e0214"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:29.946Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"5.10.275"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"5.15.226"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.1.193"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}