{"id":"CVE-2026-139623","state":"PUBLISHED","title":"bpf: Adjust pc-relative insn copied into its own patch","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Adjust pc-relative insn copied into its own patch\n\nbpf_do_misc_fixups() inits may_goto count by patching the first insn\nof a subprog with [ST, ST, first insn]. bpf_convert_ctx_accesses()\npatches insn that needs a barrier with [nospec, insn].\nbpf_adj_branches() doesn't adjust insns inside the patch, so when\nthe copy is a call, ld_imm64 of a func or a jump that points backward\nits target is off by the number of insns in front of it:\n\n  static int A(void)  { return 1; }\n  static int A2(void) { return 2; }\n  static int B(void)\n  {\n          int i, ret = A();\n\n          for (i = 0; i < 10 && can_loop; i++)\n                  ...\n          return ret;\n  }\n\nWhen A is placed in front of B and may_goto is timed 'call A' becomes\ncall of A + 2. B returns 2 when A + 2 is the start of A2. Otherwise\nthe prog is rejected with \"verifier bug: No program to jit at insn\".\n\nAdd bpf_adj_moved_insn() and use it for both copies.","publishedAt":"2026-11-30T13:36:27.728Z","updatedAt":"2026-11-30T13:36:27.728Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"e254b23685ce3638605c0a80a72fcd8e9a9515d4","versionType":"git"},{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"e76fc81e1f1494ee117be80ce843737aa7957371","versionType":"git"},{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"c4a3a9f737e728fee10a1b9353bbfc89f04040d6","versionType":"git"},{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"67a3b916a7ae7c1a6bed08555417d444de6f5838","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/fixups.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.9","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/fixups.c"]}],"references":["https://git.kernel.org/stable/c/e254b23685ce3638605c0a80a72fcd8e9a9515d4","https://git.kernel.org/stable/c/e76fc81e1f1494ee117be80ce843737aa7957371","https://git.kernel.org/stable/c/c4a3a9f737e728fee10a1b9353bbfc89f04040d6","https://git.kernel.org/stable/c/67a3b916a7ae7c1a6bed08555417d444de6f5838"],"weaknesses":[],"ingestedAt":"2026-11-30T13:52:04.503Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139623.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139623","state":"PUBLISHED","datePublished":"2026-11-30T13:36:27.728Z","dateUpdated":"2026-11-30T13:36:27.728Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.944Z"},"containers":{"cna":{"title":"bpf: Adjust pc-relative insn copied into its own patch","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Adjust pc-relative insn copied into its own patch\n\nbpf_do_misc_fixups() inits may_goto count by patching the first insn\nof a subprog with [ST, ST, first insn]. bpf_convert_ctx_accesses()\npatches insn that needs a barrier with [nospec, insn].\nbpf_adj_branches() doesn't adjust insns inside the patch, so when\nthe copy is a call, ld_imm64 of a func or a jump that points backward\nits target is off by the number of insns in front of it:\n\n  static int A(void)  { return 1; }\n  static int A2(void) { return 2; }\n  static int B(void)\n  {\n          int i, ret = A();\n\n          for (i = 0; i < 10 && can_loop; i++)\n                  ...\n          return ret;\n  }\n\nWhen A is placed in front of B and may_goto is timed 'call A' becomes\ncall of A + 2. B returns 2 when A + 2 is the start of A2. Otherwise\nthe prog is rejected with \"verifier bug: No program to jit at insn\".\n\nAdd bpf_adj_moved_insn() and use it for both copies."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"e254b23685ce3638605c0a80a72fcd8e9a9515d4","versionType":"git"},{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"e76fc81e1f1494ee117be80ce843737aa7957371","versionType":"git"},{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"c4a3a9f737e728fee10a1b9353bbfc89f04040d6","versionType":"git"},{"version":"011832b97b311bb9e3c27945bc0d1089a14209c9","status":"affected","lessThan":"67a3b916a7ae7c1a6bed08555417d444de6f5838","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/fixups.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.9","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/fixups.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/e254b23685ce3638605c0a80a72fcd8e9a9515d4"},{"url":"https://git.kernel.org/stable/c/e76fc81e1f1494ee117be80ce843737aa7957371"},{"url":"https://git.kernel.org/stable/c/c4a3a9f737e728fee10a1b9353bbfc89f04040d6"},{"url":"https://git.kernel.org/stable/c/67a3b916a7ae7c1a6bed08555417d444de6f5838"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:36:27.728Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.9","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}