Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-50036 Overview
CVE-2024-50036 is a race condition in the Linux kernel networking subsystem affecting the destination entry (dst) reference counting logic. The flaw resides in dst_release(), where dst_entries_add() is called after an RCU grace period inside dst_destroy(). By that point, the per-CPU data used by dst_entries_add() may have been freed during network namespace (netns) dismantle via ip6_route_net_exit() calling dst_entries_destroy(). The race can lead to a use-after-free condition in kernel memory. The vulnerability affects Linux kernel builds including 6.12-rc1 and 6.12-rc2 and earlier maintained branches.
Critical Impact
A local attacker triggering netns teardown while destination cache entries are still releasing can corrupt kernel memory, resulting in privilege escalation, denial of service, or disclosure of sensitive kernel data.
Affected Products
- Linux Kernel (multiple stable branches prior to the fix commits)
- Linux Kernel 6.12-rc1
- Linux Kernel 6.12-rc2
Discovery Timeline
- 2024-10-21 - CVE-2024-50036 published to NVD
- 2026-08-04 - Last updated in NVD database
Technical Details for CVE-2024-50036
Vulnerability Analysis
The Linux kernel tracks outstanding destination cache entries per network namespace using per-CPU counters. The function dst_entries_add() increments and decrements these counters when dst_entry structures are created and destroyed. During netns teardown, the kernel invokes ip6_route_net_exit(), which calls dst_entries_destroy() to tear down the per-CPU accounting data.
Before ip6_route_net_exit() runs, the kernel calls dst_release() on every destination still associated with the netns. dst_release() schedules dst_destroy() to run after an RCU grace period. That deferred dst_destroy() then calls dst_entries_add() to decrement the counter. By the time the grace period elapses, dst_entries_destroy() may have already freed the per-CPU structure, producing a use-after-free write.
An additional path exists in CONFIG_XFRM builds: dst_destroy() can invoke dst_release_immediate() on a child destination, which triggers the same unsafe decrement if the child lacks the DST_NOCOUNT flag.
Root Cause
The root cause is a lifetime mismatch between RCU-deferred destruction of dst_entry objects and immediate teardown of per-CPU destination counters at netns exit. Decrementing the destination count was deferred too late. The counter update must occur before the RCU grace period, not inside the deferred dst_destroy() callback.
Attack Vector
Exploitation requires local access and the ability to create and tear down network namespaces, typically available to processes with CAP_SYS_ADMIN within a user namespace. An attacker rapidly provisions and dismantles netns instances carrying active IPv6 route cache entries. By racing netns dismantle against RCU-deferred dst_destroy() callbacks, the attacker writes to freed per-CPU memory, enabling kernel memory corruption primitives that can escalate to arbitrary code execution in kernel context.
The vulnerability is described in prose rather than code because the fix spans multiple kernel commits; see the upstream fix commit for the authoritative change.
Detection Methods for CVE-2024-50036
Indicators of Compromise
- Kernel oops or panic messages referencing dst_destroy, dst_entries_add, or ip6_route_net_exit in dmesg or /var/log/kern.log.
- KASAN reports of use-after-free in network destination accounting paths on instrumented kernels.
- Unexpected process crashes or kernel soft lockups correlated with heavy network namespace churn.
Detection Strategies
- Audit workloads that create and destroy network namespaces at high frequency, especially container runtimes and sandboxing tools using unprivileged user namespaces.
- Monitor for processes invoking unshare(CLONE_NEWNET) or setns() from non-root UIDs on hosts running unpatched kernels.
- Correlate kernel crash telemetry with recent namespace lifecycle operations to identify race-condition triggers.
Monitoring Recommendations
- Collect kernel crash dumps and forward them to a centralized log pipeline for pattern analysis across the fleet.
- Track uname -r inventory and alert on hosts running kernel versions prior to the stable fix commits.
- Enable auditd rules for clone, unshare, and setns syscalls on sensitive hosts to establish a baseline of namespace activity.
How to Mitigate CVE-2024-50036
Immediate Actions Required
- Apply the Linux stable kernel updates containing commits 3c7c918ec0aa, ac888d58869b, and eae7435b48ff and reboot affected systems.
- Deploy distribution-provided kernel packages, including the Debian LTS update and the Debian LTS follow-up.
- Inventory container hosts and multi-tenant systems where unprivileged user namespaces are enabled and prioritize them for patching.
Patch Information
The fix moves the per-CPU destination counter decrement out of the RCU-deferred dst_destroy() path so it executes before dst_entries_destroy() can free the per-CPU data. Patched commits are available upstream at kernel.org commit 3c7c918ec0aa, commit ac888d58869b, and commit eae7435b48ff. Additional related changes are tracked in the enhancement commit and follow-up commit.
Workarounds
- Disable unprivileged user namespaces where feasible by setting kernel.unprivileged_userns_clone=0 (Debian/Ubuntu) or user.max_user_namespaces=0 to limit the attack surface.
- Restrict container runtimes to trusted workloads only until the kernel patch is deployed.
- Apply seccomp or SELinux policies that constrain unshare() and clone() with CLONE_NEWNET for untrusted processes.
# Configuration example
# Temporarily restrict unprivileged user namespaces until patched
sudo sysctl -w kernel.unprivileged_userns_clone=0
echo 'kernel.unprivileged_userns_clone=0' | sudo tee /etc/sysctl.d/99-cve-2024-50036.conf
# Verify running kernel after patch deployment
uname -r
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

