7.8high
xfrm: prevent policy_hthresh.work from racing with netns teardown
- Severity
- 7.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.10% (higher than 1% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: xfrm: prevent policy_hthresh.work from racing with netns teardown A XFRM_MSG_NEWSPDINFO request can queue the per-net work item policy_hthresh.work onto the system workqueue. The queued callback, xfrm_hash_rebuild(), retrieves the enclosing struct net via container_of(). If the net namespace is torn down before that work runs, the associated struct net may already have been freed, and xfrm_hash_rebuild() may then dereference stale memory. xfrm_policy_fini() already flushes policy_hash_work during teardown, but it does not synchronize policy_hthresh.work. Synchronize policy_hthresh.work in xfrm_policy_fini() as well, so the queued work cannot outlive the net namespace teardown and access a freed struct net.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 880a6fab8f6ba5b5abe59ea68533202ddea1012c before 56ea2257b83ee29a543f158159e3d1abc1e3e4fe, from 880a6fab8f6ba5b5abe59ea68533202ddea1012c before 8854e9367465d784046362698731c1111e3b39b8, from 880a6fab8f6ba5b5abe59ea68533202ddea1012c before 4e2e77843fef473ef47e322d52436d8308582a96, from 880a6fab8f6ba5b5abe59ea68533202ddea1012c before 29fe3a61bcdce398ee3955101c39f89c01a8a77e, 3.18 Not affected: before 3.18, from 6.12.80 up to 6.12.*, from 6.18.21 up to 6.18.*, from 6.19.11 up to 6.19.*, from 7.0 up to * | CVE List |
| linux linux_kernel | from 3.18.1 before 6.12.80, from 6.13 before 6.18.21, from 6.19 before 6.19.11, 3.18, 7.0 | NVD |
Classification
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: xfrm: prevent policy_hthresh.work from racing with netns teardown A XFRM_MSG_NEWSPDINFO request can queue the per-net work item policy_hthresh.work onto the system workqueue. The queued callback, xfrm_hash_rebuild(), retrieves the enclosing struct net via container_of(). If the net namespace is torn down before that work runs, the associated struct net may already have been freed, and xfrm_hash_rebuild() may then dereference stale memory. xfrm_policy_fini() already flushes policy_hash_work during teardown, but it does not synchronize policy_hthresh.work. Synchronize policy_hthresh.work in xfrm_policy_fini() as well, so the queued work cannot outlive the net namespace teardown and access a freed struct net.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: xfrm: evitar que policy_hthresh.work compita con el desmantelamiento de netns Una solicitud XFRM_MSG_NEWSPDINFO puede encolar el elemento de trabajo por red policy_hthresh.work en la cola de trabajo del sistema. La devolución de llamada encolada, xfrm_hash_rebuild(), recupera la struct net contenedora a través de container_of(). Si el espacio de nombres de red es desmantelado antes de que se ejecute ese trabajo, la struct net asociada puede que ya haya sido liberada, y xfrm_hash_rebuild() puede entonces desreferenciar memoria obsoleta. xfrm_policy_fini() ya vacía policy_hash_work durante el desmantelamiento, pero no sincroniza policy_hthresh.work. Sincronizar policy_hthresh.work también en xfrm_policy_fini(), para que el trabajo encolado no pueda sobrevivir al desmantelamiento del espacio de nombres de red y acceder a una struct net liberada.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-31516 changed 2026-10-19 | CVE Terms of Use |
| NVD | CVE-2026-31516 changed 2026-11-11 | Public domain |