{"id":"CVE-2026-139286","state":"PUBLISHED","title":"bpf: Zero-extend the index in inlined bpf_get_func_arg()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Zero-extend the index in inlined bpf_get_func_arg()\n\nbpf_get_func_arg() takes a u32 index, but the inlined expansion compared\nonly the low 32 bits of R2 with the argument count and then shifted the\nfull 64-bit register to compute the context address. R2 is ARG_ANYTHING,\nso nothing guarantees that its upper bits are zero: an index of\n1ULL << 32 passes the bounds check as index zero while the load is\nperformed at ctx + (1ULL << 35).\n\nShift the index as a 32-bit value. When the 32-bit bounds check passes,\nthe low 32 bits of R2 are below R0, and R0 is at most 255: the trampoline\narm masks the argument count with 0xFF and the raw_tp arm uses the BTF\nargument count minus one, which the verifier caps at MAX_BPF_FUNC_ARGS.\nThe 3-bit shift therefore cannot overflow and it clears the upper bits of\nthe register. Widening the comparison instead would reject indices whose\nlow 32 bits are valid. The check itself is unchanged, so this cannot\nchange which programs are accepted, only the address that is computed.","publishedAt":"2026-11-30T13:33:21.009Z","updatedAt":"2026-11-30T13:33:21.009Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f92c1e183604c20ce00eb889315fdaa8f2d9e509","status":"affected","lessThan":"c463072e5da49b210a7e0ead600feea6a432a7fc","versionType":"git"},{"version":"f92c1e183604c20ce00eb889315fdaa8f2d9e509","status":"affected","lessThan":"7e3a5e1e3d57034d11e7aba5146daf3e8d460864","versionType":"git"},{"version":"f92c1e183604c20ce00eb889315fdaa8f2d9e509","status":"affected","lessThan":"85f8579916b99cdd31788b9dfd241d0e9752f5dc","versionType":"git"},{"version":"f92c1e183604c20ce00eb889315fdaa8f2d9e509","status":"affected","lessThan":"1c1dda9ba9f3af9cd511a197dcc86de2465d8fe5","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":"5.17","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.17","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/c463072e5da49b210a7e0ead600feea6a432a7fc","https://git.kernel.org/stable/c/7e3a5e1e3d57034d11e7aba5146daf3e8d460864","https://git.kernel.org/stable/c/85f8579916b99cdd31788b9dfd241d0e9752f5dc","https://git.kernel.org/stable/c/1c1dda9ba9f3af9cd511a197dcc86de2465d8fe5"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139286.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139286","state":"PUBLISHED","datePublished":"2026-11-30T13:33:21.009Z","dateUpdated":"2026-11-30T13:33:21.009Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.924Z"},"containers":{"cna":{"title":"bpf: Zero-extend the index in inlined bpf_get_func_arg()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Zero-extend the index in inlined bpf_get_func_arg()\n\nbpf_get_func_arg() takes a u32 index, but the inlined expansion compared\nonly the low 32 bits of R2 with the argument count and then shifted the\nfull 64-bit register to compute the context address. R2 is ARG_ANYTHING,\nso nothing guarantees that its upper bits are zero: an index of\n1ULL << 32 passes the bounds check as index zero while the load is\nperformed at ctx + (1ULL << 35).\n\nShift the index as a 32-bit value. When the 32-bit bounds check passes,\nthe low 32 bits of R2 are below R0, and R0 is at most 255: the trampoline\narm masks the argument count with 0xFF and the raw_tp arm uses the BTF\nargument count minus one, which the verifier caps at MAX_BPF_FUNC_ARGS.\nThe 3-bit shift therefore cannot overflow and it clears the upper bits of\nthe register. Widening the comparison instead would reject indices whose\nlow 32 bits are valid. The check itself is unchanged, so this cannot\nchange which programs are accepted, only the address that is computed."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f92c1e183604c20ce00eb889315fdaa8f2d9e509","status":"affected","lessThan":"c463072e5da49b210a7e0ead600feea6a432a7fc","versionType":"git"},{"version":"f92c1e183604c20ce00eb889315fdaa8f2d9e509","status":"affected","lessThan":"7e3a5e1e3d57034d11e7aba5146daf3e8d460864","versionType":"git"},{"version":"f92c1e183604c20ce00eb889315fdaa8f2d9e509","status":"affected","lessThan":"85f8579916b99cdd31788b9dfd241d0e9752f5dc","versionType":"git"},{"version":"f92c1e183604c20ce00eb889315fdaa8f2d9e509","status":"affected","lessThan":"1c1dda9ba9f3af9cd511a197dcc86de2465d8fe5","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":"5.17","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.17","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/c463072e5da49b210a7e0ead600feea6a432a7fc"},{"url":"https://git.kernel.org/stable/c/7e3a5e1e3d57034d11e7aba5146daf3e8d460864"},{"url":"https://git.kernel.org/stable/c/85f8579916b99cdd31788b9dfd241d0e9752f5dc"},{"url":"https://git.kernel.org/stable/c/1c1dda9ba9f3af9cd511a197dcc86de2465d8fe5"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:21.009Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.17","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.17","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.17","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.17","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}