7.8high
netfilter: ctnetlink: ensure safe access to master conntrack
- 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: netfilter: ctnetlink: ensure safe access to master conntrack Holding reference on the expectation is not sufficient, the master conntrack object can just go away, making exp->master invalid. To access exp->master safely: - Grab the nf_conntrack_expect_lock, this gets serialized with clean_from_lists() which also holds this lock when the master conntrack goes away. - Hold reference on master conntrack via nf_conntrack_find_get(). Not so easy since the master tuple to look up for the master conntrack is not available in the existing problematic paths. This patch goes for extending the nf_conntrack_expect_lock section to address this issue for simplicity, in the cases that are described below this is just slightly extending the lock section. The add expectation command already holds a reference to the master conntrack from ctnetlink_create_expect(). However, the delete expectation command needs to grab the spinlock before looking up for the expectation. Expand the existing spinlock section to address this to cover the expectation lookup. Note that, the nf_ct_expect_iterate_net() calls already grabs the spinlock while iterating over the expectation table, which is correct. The get expectation command needs to grab the spinlock to ensure master conntrack does not go away. This also expands the existing spinlock section to cover the expectation lookup too. I needed to move the netlink skb allocation out of the spinlock to keep it GFP_KERNEL. For the expectation events, the IPEXP_DESTROY event is already delivered under the spinlock, just move the delivery of IPEXP_NEW under the spinlock too because the master conntrack event cache is reached through exp->master. While at it, add lockdep notations to help identify what codepaths need to grab the spinlock.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from c1d10adb4a521de5760112853f42aaeefcec96eb before 9e1196d27ef496f404c76f7a9d03761142d991c4, from c1d10adb4a521de5760112853f42aaeefcec96eb before 5e1c1d22268ae710c238342c8030c21daf298168, from c1d10adb4a521de5760112853f42aaeefcec96eb before d52fa1fa7440676b8c238037a050ab008c22737f, from c1d10adb4a521de5760112853f42aaeefcec96eb before f338ced0473849c9f6ed0b77ca99f1aab5826787, from c1d10adb4a521de5760112853f42aaeefcec96eb before 497f99b26fffdc5635706d1b4811f1ed8ee21a5b, from c1d10adb4a521de5760112853f42aaeefcec96eb before bffcaad9afdfe45d7fc777397d3b83c1e3ebffe5, 2.6.16 Not affected: before 2.6.16, from 6.1.176 up to 6.1.*, from 6.6.143 up to 6.6.*, from 6.12.94 up to 6.12.*, from 6.18.24 up to 6.18.*, from 6.19.14 up to 6.19.* | CVE List |
| linux linux_kernel | from 2.6.16 before 6.18.24, from 6.19 before 6.19.14, 7.0 | NVD |
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: netfilter: ctnetlink: ensure safe access to master conntrack Holding reference on the expectation is not sufficient, the master conntrack object can just go away, making exp->master invalid. To access exp->master safely: - Grab the nf_conntrack_expect_lock, this gets serialized with clean_from_lists() which also holds this lock when the master conntrack goes away. - Hold reference on master conntrack via nf_conntrack_find_get(). Not so easy since the master tuple to look up for the master conntrack is not available in the existing problematic paths. This patch goes for extending the nf_conntrack_expect_lock section to address this issue for simplicity, in the cases that are described below this is just slightly extending the lock section. The add expectation command already holds a reference to the master conntrack from ctnetlink_create_expect(). However, the delete expectation command needs to grab the spinlock before looking up for the expectation. Expand the existing spinlock section to address this to cover the expectation lookup. Note that, the nf_ct_expect_iterate_net() calls already grabs the spinlock while iterating over the expectation table, which is correct. The get expectation command needs to grab the spinlock to ensure master conntrack does not go away. This also expands the existing spinlock section to cover the expectation lookup too. I needed to move the netlink skb allocation out of the spinlock to keep it GFP_KERNEL. For the expectation events, the IPEXP_DESTROY event is already delivered under the spinlock, just move the delivery of IPEXP_NEW under the spinlock too because the master conntrack event cache is reached through exp->master. While at it, add lockdep notations to help identify what codepaths need to grab the spinlock.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: netfilter: ctnetlink: asegurar acceso seguro a conntrack maestro Mantener una referencia sobre la expectativa no es suficiente, el objeto conntrack maestro puede simplemente desaparecer, haciendo que exp -> master sea inválido. Para acceder a exp -> master de forma segura: - Adquirir el nf_conntrack_expect_lock, esto se serializa con clean_from_lists() que también mantiene este bloqueo cuando el conntrack maestro desaparece. - Mantener una referencia sobre el conntrack maestro a través de nf_conntrack_find_get(). No es tan fácil ya que la tupla maestra para buscar el conntrack maestro no está disponible en las rutas problemáticas existentes. Este parche opta por extender la sección nf_conntrack_expect_lock para abordar este problema por simplicidad; en los casos que se describen a continuación, esto solo extiende ligeramente la sección de bloqueo. El comando de añadir expectativa ya mantiene una referencia al conntrack maestro desde ctnetlink_create_expect(). Sin embargo, el comando de eliminar expectativa necesita adquirir el spinlock antes de buscar la expectativa. Expandir la sección de spinlock existente para abordar esto y cubrir la búsqueda de la expectativa. Tenga en cuenta que las llamadas a nf_ct_expect_iterate_net() ya adquieren el spinlock mientras iteran sobre la tabla de expectativas, lo cual es correcto. El comando de obtener expectativa necesita adquirir el spinlock para asegurar que el conntrack maestro no desaparezca. Esto también expande la sección de spinlock existente para cubrir también la búsqueda de la expectativa. Necesité mover la asignación de netlink skb fuera del spinlock para mantenerla GFP_KERNEL. Para los eventos de expectativa, el evento IPEXP_DESTROY ya se entrega bajo el spinlock; simplemente mueva la entrega de IPEXP_NEW también bajo el spinlock porque la caché de eventos del conntrack maestro se alcanza a través de exp -> master. Ya que estamos, añada anotaciones de lockdep para ayudar a identificar qué rutas de código necesitan adquirir el spinlock.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-43116 changed 2026-11-10 | CVE Terms of Use |
| NVD | CVE-2026-43116 changed 2026-11-11 | Public domain |