xfrm: Wait for RCU readers during policy netns exit
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e1e551bc56302b80ff930c966f9985095fb1b70d · < 069daad4f2ae9c5c108131995529d5f02392c446| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
xfrm: Wait for RCU readers during policy netns exit
xfrm_policy_fini() frees the policy_bydst hash tables after flushing the policy work items and deleting all policies, but it does not wait for concurrent RCU readers to leave their read-side critical sections first.
The policy_bydst tables are published via rcu_assign_pointer() and are looked up through rcu_dereference_check(), so netns teardown must also wait for an RCU grace period before freeing the table memory.
Fix this by adding synchronize_rcu() before freeing the policy hash tables.
From the CVE record · Linux
During network namespace teardown, the Linux kernel can free xfrm policy hash tables while RCU readers are still using them, creating a use-after-free condition. The input does not establish how an attacker could trigger it or specify network access, authentication, or user-interaction requirements.
Anyone running the Linux kernel should check whether their version includes the xfrm policy teardown fix; affected versions are not specified.