7.8high
bpf: Fix netns reference imbalance in conntrack kfuncs
- Severity
- 7.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.13% (higher than 2% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix netns reference imbalance in conntrack kfuncs The opts argument of the BPF conntrack kfuncs can point to a shared map value. __bpf_nf_ct_lookup() and __bpf_nf_ct_alloc_entry() read opts->netns_id separately when acquiring and releasing the network namespace reference. The reference imbalance can occur as follows: CPU 0 CPU 1 read opts->netns_id (-1) skip get_net_ns_by_id() write opts->netns_id (id) read opts->netns_id (id) put_net(net) /* no matching get */ The reverse transition leaks the reference. Repeating the unmatched put can destroy a live namespace and crash later users. The kernel reported: Oops: general protection fault, probably for non-canonical address KASAN: null-ptr-deref in range [0x00000000000000e8-0x00000000000000ef] RIP: 0010:bpf_prog_test_run_xdp+0x52c/0x1700 Call Trace: __sys_bpf+0x1662/0x50c0 __x64_sys_bpf+0x73/0xb0 do_syscall_64+0xf9/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f Kernel panic - not syncing: Fatal exception Snapshot every input field of opts with READ_ONCE() before validating or using it. The netns_id snapshot keeps the namespace get/put pair balanced, while the other snapshots keep the remaining options from changing partway through an invocation. The individual reads can still observe an inconsistent combination during a concurrent update, but each selected field value remains stable for that invocation.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from aed8ee7feb44b6537af1e0b4f03365d42928be38 before cfde990193135a35637e55f69e83e4ab441e60ab, from aed8ee7feb44b6537af1e0b4f03365d42928be38 before fb22bedf0c4f4f05bfa6e4a7ec0fd97bbdff9ce8, from aed8ee7feb44b6537af1e0b4f03365d42928be38 before 41731d4290400cb898f15f049ae4018d45415e69, from aed8ee7feb44b6537af1e0b4f03365d42928be38 before 4af94462c0ca2187a02a1a6641020ae888c74d5c, from aed8ee7feb44b6537af1e0b4f03365d42928be38 before e5e060eb63d10b41ab60fd955649479d99b38210, from aed8ee7feb44b6537af1e0b4f03365d42928be38 before fdeba03fea78407a8c52faa99177c9f7f29f90eb, 6.0 Not affected: before 6.0, from 6.1.191 up to 6.1.*, from 6.6.160 up to 6.6.*, from 6.12.114 up to 6.12.*, from 6.18.57 up to 6.18.*, from 7.1.9 up to 7.1.* | CVE List |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix netns reference imbalance in conntrack kfuncs The opts argument of the BPF conntrack kfuncs can point to a shared map value. __bpf_nf_ct_lookup() and __bpf_nf_ct_alloc_entry() read opts->netns_id separately when acquiring and releasing the network namespace reference. The reference imbalance can occur as follows: CPU 0 CPU 1 read opts->netns_id (-1) skip get_net_ns_by_id() write opts->netns_id (id) read opts->netns_id (id) put_net(net) /* no matching get */ The reverse transition leaks the reference. Repeating the unmatched put can destroy a live namespace and crash later users. The kernel reported: Oops: general protection fault, probably for non-canonical address KASAN: null-ptr-deref in range [0x00000000000000e8-0x00000000000000ef] RIP: 0010:bpf_prog_test_run_xdp+0x52c/0x1700 Call Trace: __sys_bpf+0x1662/0x50c0 __x64_sys_bpf+0x73/0xb0 do_syscall_64+0xf9/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f Kernel panic - not syncing: Fatal exception Snapshot every input field of opts with READ_ONCE() before validating or using it. The netns_id snapshot keeps the namespace get/put pair balanced, while the other snapshots keep the remaining options from changing partway through an invocation. The individual reads can still observe an inconsistent combination during a concurrent update, but each selected field value remains stable for that invocation.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: bpf: Soluciona el desequilibrio de referencia de netns en las kfuncs de conntrack El argumento opts de las kfuncs de conntrack de BPF puede apuntar a un valor de mapa compartido. __bpf_nf_ct_lookup() y __bpf_nf_ct_alloc_entry() leen opts -> netns_id por separado al adquirir y liberar la referencia del espacio de nombres de red. El desequilibrio de referencia puede ocurrir de la siguiente manera: CPU 0 CPU 1 lee opts -> netns_id (-1) omite get_net_ns_by_id() escribe opts -> netns_id (id) lee opts -> netns_id (id) put_net(net) /* no hay 'get' coincidente */ La transición inversa filtra la referencia. Repetir el 'put' sin coincidencia puede destruir un espacio de nombres activo y provocar un fallo en usuarios posteriores. El kernel informó: Oops: fallo de protección general, probablemente por dirección no canónica KASAN: null-ptr-deref en el rango [0x00000000000000e8-0x00000000000000ef] RIP: 0010:bpf_prog_test_run_xdp+0x52c/0x1700 Call Trace: __sys_bpf+0x1662/0x50c0 __x64_sys_bpf+0x73/0xb0 do_syscall_64+0xf9/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f Pánico del kernel - no sincronizando: Excepción fatal Realice una instantánea de cada campo de entrada de opts con READ_ONCE() antes de validarlo o usarlo. La instantánea de netns_id mantiene equilibrado el par 'get/put' del espacio de nombres, mientras que las otras instantáneas evitan que las opciones restantes cambien a mitad de una invocación. Las lecturas individuales aún pueden observar una combinación inconsistente durante una actualización concurrente, pero cada valor de campo seleccionado permanece estable para esa invocación.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-74715 changed 2026-10-30 | CVE Terms of Use |
| NVD | CVE-2026-74715 changed 2026-10-30 | Public domain |