{"id":"CVE-2026-139308","summary":"bpf: Fix stale offload-\u003eprog pointer after realloc","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix stale offload-\u003eprog pointer after realloc\n\nbpf_prog_realloc() moves a program that the rewrites of the verifier make\noutgrow its pages.  It updates aux-\u003eprog, but not the offload-\u003eprog 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-\u003eprog 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-\u003eprog 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.","modified":"2026-11-30T15:01:11.969702030Z","published":"2026-11-30T13:33:33.238Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139308.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2190de7333369052fff76ccb686567ea648350b6"},{"type":"WEB","url":"https://git.kernel.org/stable/c/4afa9934aa8da40d8b03d7f18ddbee7113bc8f9b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/80d3aaf751b9a2a1d204f3ee4e2ef3bb1207cbc9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/87c3268b4acac6942d1dbf600edbf6374be0c91b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8e83d53596445fcf5b0385e5fbe8bcd971e06d06"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139308.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139308"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"ab3f0063c48c26c927851b6767824e35a716d878"},{"fixed":"2190de7333369052fff76ccb686567ea648350b6"},{"fixed":"4afa9934aa8da40d8b03d7f18ddbee7113bc8f9b"},{"fixed":"87c3268b4acac6942d1dbf600edbf6374be0c91b"},{"fixed":"80d3aaf751b9a2a1d204f3ee4e2ef3bb1207cbc9"},{"fixed":"8e83d53596445fcf5b0385e5fbe8bcd971e06d06"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139308.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.15.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.119"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.65"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.6"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139308.json"}}],"schema_version":"1.9.2"}