CVE-2024-50036 net: do not delay dst_entries_add() in dst_release()
A race condition in Linux kernel networking allows use-after-free during namespace teardown, potentially leading to code execution or denial of service.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-50036?
CVE-2024-50036 is a high-severity use after free vulnerability in Linux kernel, published on 21 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
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.
2) There is also discussion about removing this count of dst, which might happen in future kernels.
Which versions are affected by CVE-2024-50036?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-50036?
Apply the vendor's patch.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2024-50036 being exploited?
There is no known exploitation of CVE-2024-50036 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-51365, AZL-51476, BELL-CVE-2024-50036, DEBIAN-CVE-2024-50036, GHSA-5v92-qmvx-fgv4, UBUNTU-CVE-2024-50036.