{"id":"CVE-2026-139621","state":"PUBLISHED","title":"bpf: Don't converge a loop on an iterator that was created anew","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Don't converge a loop on an iterator that was created anew\n\nWhen the verifier reaches bpf_iter_*_next() in a state that is equal to\na state that is still being explored it concludes that the loop\nconverged, since an active iterator will be drained eventually.\nstates_equal() matches ids through idmap, so the same is concluded for\nan iterator that was destroyed and created again since the old state:\n\n  bpf_iter_num_new(&it, 0, 10);\n  loop:\n          if (bpf_ktime_get_ns())\n                  goto remake;\n  next:\n          if (!bpf_iter_num_next(&it))\n                  goto out;\n          goto loop;\n  remake:\n          bpf_iter_num_destroy(&it);\n          bpf_iter_num_new(&it, 0, 10);\n          goto next;\n\nSuch prog is accepted when the call of bpf_iter_num_next() is the first\nprune point after bpf_iter_num_new() and it never returns. Otherwise\nit's rejected with \"infinite loop detected\".\n\nRequire the iterator to have the same id in both states.","publishedAt":"2026-11-30T13:36:26.614Z","updatedAt":"2026-11-30T13:36:26.614Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"06accc8779c1d558a5b5a21f2ac82b0c95827ddd","status":"affected","lessThan":"f5d3e5382dbca1a639fe124a38acd526155a5103","versionType":"git"},{"version":"06accc8779c1d558a5b5a21f2ac82b0c95827ddd","status":"affected","lessThan":"fe416645a7c67cd7d1127ea707e7027145ddf2c5","versionType":"git"},{"version":"06accc8779c1d558a5b5a21f2ac82b0c95827ddd","status":"affected","lessThan":"cc3ad4a2f4812f1efeb6fff6eba6260f8fc6faa6","versionType":"git"},{"version":"06accc8779c1d558a5b5a21f2ac82b0c95827ddd","status":"affected","lessThan":"6f3ee3516305da3043f1787e3890381a54151730","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/states.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.4","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":["kernel/bpf/states.c"]}],"references":["https://git.kernel.org/stable/c/f5d3e5382dbca1a639fe124a38acd526155a5103","https://git.kernel.org/stable/c/fe416645a7c67cd7d1127ea707e7027145ddf2c5","https://git.kernel.org/stable/c/cc3ad4a2f4812f1efeb6fff6eba6260f8fc6faa6","https://git.kernel.org/stable/c/6f3ee3516305da3043f1787e3890381a54151730"],"weaknesses":[],"ingestedAt":"2026-11-30T13:52:04.503Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139621.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139621","state":"PUBLISHED","datePublished":"2026-11-30T13:36:26.614Z","dateUpdated":"2026-11-30T13:36:26.614Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.944Z"},"containers":{"cna":{"title":"bpf: Don't converge a loop on an iterator that was created anew","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Don't converge a loop on an iterator that was created anew\n\nWhen the verifier reaches bpf_iter_*_next() in a state that is equal to\na state that is still being explored it concludes that the loop\nconverged, since an active iterator will be drained eventually.\nstates_equal() matches ids through idmap, so the same is concluded for\nan iterator that was destroyed and created again since the old state:\n\n  bpf_iter_num_new(&it, 0, 10);\n  loop:\n          if (bpf_ktime_get_ns())\n                  goto remake;\n  next:\n          if (!bpf_iter_num_next(&it))\n                  goto out;\n          goto loop;\n  remake:\n          bpf_iter_num_destroy(&it);\n          bpf_iter_num_new(&it, 0, 10);\n          goto next;\n\nSuch prog is accepted when the call of bpf_iter_num_next() is the first\nprune point after bpf_iter_num_new() and it never returns. Otherwise\nit's rejected with \"infinite loop detected\".\n\nRequire the iterator to have the same id in both states."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"06accc8779c1d558a5b5a21f2ac82b0c95827ddd","status":"affected","lessThan":"f5d3e5382dbca1a639fe124a38acd526155a5103","versionType":"git"},{"version":"06accc8779c1d558a5b5a21f2ac82b0c95827ddd","status":"affected","lessThan":"fe416645a7c67cd7d1127ea707e7027145ddf2c5","versionType":"git"},{"version":"06accc8779c1d558a5b5a21f2ac82b0c95827ddd","status":"affected","lessThan":"cc3ad4a2f4812f1efeb6fff6eba6260f8fc6faa6","versionType":"git"},{"version":"06accc8779c1d558a5b5a21f2ac82b0c95827ddd","status":"affected","lessThan":"6f3ee3516305da3043f1787e3890381a54151730","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/states.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.4","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":["kernel/bpf/states.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/f5d3e5382dbca1a639fe124a38acd526155a5103"},{"url":"https://git.kernel.org/stable/c/fe416645a7c67cd7d1127ea707e7027145ddf2c5"},{"url":"https://git.kernel.org/stable/c/cc3ad4a2f4812f1efeb6fff6eba6260f8fc6faa6"},{"url":"https://git.kernel.org/stable/c/6f3ee3516305da3043f1787e3890381a54151730"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:36:26.614Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}