net: do not delay dst_entries_add() in dst_release()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ f88649721268999bdff09777847080a52004f691 · < ac888d58869bb99753e7652be19a151df9ecb35d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: do not delay dst_entries_add() in dst_release()
dst_entries_add() uses per-cpu data that might be freed at netns dismantle from ip6_route_net_exit() calling dst_entries_destroy()
Before ip6_route_net_exit() can be called, we release all the dsts associated with this netns, via calls to dst_release(), which waits an rcu grace period before calling dst_destroy()
dst_entries_add() use in dst_destroy() is racy, because dst_entries_destroy() could have been called already.
Decrementing the number of dsts must happen sooner.
Notes:
1) in CONFIG_XFRM case, dst_destroy() can call dst_release_immediate(child), this might also cause UAF if the child does not have DST_NOCOUNT set. IPSEC maintainers might take a look and see how to address this.
From the CVE record · Linux
The Linux kernel has a race during network namespace teardown: destination-entry accounting can access per-CPU data after it has been freed. This can cause a use-after-free; the input does not specify how an attacker could trigger it or whether access or user interaction is required.
Anyone running the Linux kernel should check their version against the vendor advisory; affected versions are not specified in the input.