{"id":"CVE-2026-139308","state":"PUBLISHED","title":"bpf: Fix stale offload->prog pointer after realloc","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix stale offload->prog pointer after realloc\n\nbpf_prog_realloc() moves a program that the rewrites of the verifier make\noutgrow its pages.  It updates aux->prog, but not the offload->prog of a\ndevice-bound program.  When the device is unregistered,\n__bpf_offload_dev_netdev_unregister() hands the stale pointer to\n__bpf_prog_offload_destroy(), which faults on the freed program:\n\n  BUG: unable to handle page fault for address: ffffc90000071050\n  RIP: 0010:__bpf_prog_offload_destroy+0x3f/0x310\n\nIt takes the right to load a device-bound XDP program, CAP_BPF and\nCAP_NET_ADMIN or a BPF token, and a device that can be removed.\n\nCommit a1aa9ef47c29 (\"bpf: Fix stale offload->prog pointer after constant\nblinding\") repaired the other place that replaces a program.  Do the same\nhere.\n\nNothing keeps the device while a program is loaded, so it can also be\nunregistered at that very moment.  That frees the offload, and it may have\nread offload->prog already when the old copy of the program is freed.  In\nboth places update the pointer under bpf_devs_lock, before the old copy\ngoes.","publishedAt":"2026-11-30T13:33:33.238Z","updatedAt":"2026-11-30T13:33:33.238Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"2190de7333369052fff76ccb686567ea648350b6","versionType":"git"},{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"4afa9934aa8da40d8b03d7f18ddbee7113bc8f9b","versionType":"git"},{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"87c3268b4acac6942d1dbf600edbf6374be0c91b","versionType":"git"},{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"80d3aaf751b9a2a1d204f3ee4e2ef3bb1207cbc9","versionType":"git"},{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"8e83d53596445fcf5b0385e5fbe8bcd971e06d06","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf.h","kernel/bpf/core.c","kernel/bpf/offload.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.15","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":["include/linux/bpf.h","kernel/bpf/core.c","kernel/bpf/offload.c"]}],"references":["https://git.kernel.org/stable/c/2190de7333369052fff76ccb686567ea648350b6","https://git.kernel.org/stable/c/4afa9934aa8da40d8b03d7f18ddbee7113bc8f9b","https://git.kernel.org/stable/c/87c3268b4acac6942d1dbf600edbf6374be0c91b","https://git.kernel.org/stable/c/80d3aaf751b9a2a1d204f3ee4e2ef3bb1207cbc9","https://git.kernel.org/stable/c/8e83d53596445fcf5b0385e5fbe8bcd971e06d06"],"weaknesses":[],"ingestedAt":"2026-11-30T13:46:04.484Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139308.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139308","state":"PUBLISHED","datePublished":"2026-11-30T13:33:33.238Z","dateUpdated":"2026-11-30T13:33:33.238Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.926Z"},"containers":{"cna":{"title":"bpf: Fix stale offload->prog pointer after realloc","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix stale offload->prog pointer after realloc\n\nbpf_prog_realloc() moves a program that the rewrites of the verifier make\noutgrow its pages.  It updates aux->prog, but not the offload->prog of a\ndevice-bound program.  When the device is unregistered,\n__bpf_offload_dev_netdev_unregister() hands the stale pointer to\n__bpf_prog_offload_destroy(), which faults on the freed program:\n\n  BUG: unable to handle page fault for address: ffffc90000071050\n  RIP: 0010:__bpf_prog_offload_destroy+0x3f/0x310\n\nIt takes the right to load a device-bound XDP program, CAP_BPF and\nCAP_NET_ADMIN or a BPF token, and a device that can be removed.\n\nCommit a1aa9ef47c29 (\"bpf: Fix stale offload->prog pointer after constant\nblinding\") repaired the other place that replaces a program.  Do the same\nhere.\n\nNothing keeps the device while a program is loaded, so it can also be\nunregistered at that very moment.  That frees the offload, and it may have\nread offload->prog already when the old copy of the program is freed.  In\nboth places update the pointer under bpf_devs_lock, before the old copy\ngoes."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"2190de7333369052fff76ccb686567ea648350b6","versionType":"git"},{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"4afa9934aa8da40d8b03d7f18ddbee7113bc8f9b","versionType":"git"},{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"87c3268b4acac6942d1dbf600edbf6374be0c91b","versionType":"git"},{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"80d3aaf751b9a2a1d204f3ee4e2ef3bb1207cbc9","versionType":"git"},{"version":"ab3f0063c48c26c927851b6767824e35a716d878","status":"affected","lessThan":"8e83d53596445fcf5b0385e5fbe8bcd971e06d06","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/bpf.h","kernel/bpf/core.c","kernel/bpf/offload.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.15","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.15","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":["include/linux/bpf.h","kernel/bpf/core.c","kernel/bpf/offload.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/2190de7333369052fff76ccb686567ea648350b6"},{"url":"https://git.kernel.org/stable/c/4afa9934aa8da40d8b03d7f18ddbee7113bc8f9b"},{"url":"https://git.kernel.org/stable/c/87c3268b4acac6942d1dbf600edbf6374be0c91b"},{"url":"https://git.kernel.org/stable/c/80d3aaf751b9a2a1d204f3ee4e2ef3bb1207cbc9"},{"url":"https://git.kernel.org/stable/c/8e83d53596445fcf5b0385e5fbe8bcd971e06d06"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:33:33.238Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.15","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}