CVE-2026-80845 PUBLISHED

xfrm: avoid lock inversion in nat keepalive work

Assigner: Linux
Reserved: 26.08.2026 Published: 04.09.2026 Updated: 04.09.2026

In the Linux kernel, the following vulnerability has been resolved:

xfrm: avoid lock inversion in nat keepalive work

nat_keepalive_work() walks the state table while xfrm_state_walk() holds net->xfrm.xfrm_state_lock. Its callback then acquires x->lock, which conflicts with the delete path taking the same locks in reverse order via xfrm_state_delete() and __xfrm_state_delete(). This creates an AB-BA deadlock that is reported by lockdep when a NAT keepalive worker races with SA deletion.

Fix this by splitting the keepalive walk into two phases. First, collect the candidate states while the walk holds xfrm_state_lock and take a reference on each state. Then, after the walk completes, process each collected state and acquire x->lock without nesting it under xfrm_state_lock.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae to ea09210462316e5235a25eccb11ad0708d86615e (excl.)
  • affected from f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae to 5c86c895d1cac81a71ead3005084c6265cf6a7a5 (excl.)
  • affected from f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae to 89ef3a2e1e4682ab82b0455ce113f8c39fb9e50d (excl.)
  • affected from f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae to a9fa05b7a1246797748d15771052639e0d3cabf1 (excl.)
  • affected from f531d13bdfe3f4f084aaa8acae2cb0f02295f5ae to 763fe700b7c58ad64fe5202c5638848244dd4127 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 6.11 is affected
  • unaffected from 0 to 6.11 (excl.)
  • unaffected from 6.12.108 to 6.12.* (incl.)
  • unaffected from 6.18.49 to 6.18.* (incl.)
  • unaffected from 7.1.13 to 7.1.* (incl.)
  • unaffected from 7.2.3 to 7.2.* (incl.)
  • unaffected from 7.3-rc1 to * (incl.)

References