Skip to main content
← All vulnerabilities
CVE-2024-36971

net: fix __dst_negative_advice() race

Affects the Linux kernel network stack for UDP sockets in kernels containing commit a87cb3e48ee8 and later. Fixed by the listed upstream commits in several stable branches. No vendor rating is given.

Published
Last modified
published
Listed in CISA KEV
Actively exploited
Fix
Fix or patch referenced
None on Exploit-DB, Metasploit or GitHub

Summary

The Linux kernel's networking stack, specifically the destination cache handling used by TCP and UDP sockets, is affected. A race condition in how cached route entries are cleared could allow a use-after-free, which may lead to memory corruption and potentially a system crash or unpredictable behavior.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original description

In the Linux kernel, the following vulnerability has been resolved: net: fix __dst_negative_advice() race __dst_negative_advice() does not enforce proper RCU rules when sk->dst_cache must be cleared, leading to possible UAF. RCU rules are that we must first clear sk->sk_dst_cache, then call dst_release(old_dst). Note that sk_dst_reset(sk) is implementing this protocol correctly, while __dst_negative_advice() uses the wrong order. Given that ip6_negative_advice() has special logic against RTF_CACHE, this means each of the three ->negative_advice() existing methods must perform the sk_dst_reset() themselves. Note the check against NULL dst is centralized in __dst_negative_advice(), there is no need to duplicate it in various callbacks. Many thanks to Clement Lecigne for tracking this issue. This old bug became visible after the blamed commit, using UDP sockets.

Timeline

  1. CVE published
  2. Added to CISA KEV

    CISA has evidence of exploitation in the wild

  3. CISA remediation deadline

    Due date for US federal agencies to patch

  4. Record last updated

Affected versions

  • Linux Linux

    From a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 · fixed in 051c0bde9f0450a2ec3d62a86d2a0d2fad117f13; From a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 · fixed in db0082825037794c5dba9959c9de13ca34cc5e72; From a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 · fixed in 2295a7ef5c8c49241bff769e7826ef2582e532a6; From a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 · fixed in eacb8b195579c174a6d3e12a9690b206eb7f28cf; From a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 · fixed in 81dd3c82a456b0015461754be7cb2693991421b4; From a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 · fixed in 5af198c387128a9d2ddd620b0f0803564a4d4508; From a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 · fixed in b8af8e6118a6605f0e495a58d591ca94a85a50fc; From a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 · fixed in 92f1655aa2b2294d0b49925f3b875a634bd3b59e

  • Linux Linux

    4.6

References 8

git.kernel.org

FAQ

Questions about CVE-2024-36971

What does this mean?

The kernel's __dst_negative_advice() function has a race caused by incorrect RCU ordering when it clears a socket's cached destination entry. This can lead to a possible use-after-free. The bug became visible after commit a87cb3e48ee8, when UDP sockets were used.Source: git.kernel.org

Am I affected, and how do I check?

Kernels that include commit a87cb3e48ee86d29868d3f59cfb9ce1a8fa63314 and do not yet include the matching fixing commit for their stable branch. To check, look at the kernel's git history for that commit and the listed fixing commits, or compare the kernel version with the stable release that carries the fix. The issue concerns UDP socket use.Source: git.kernel.org

What should I do about it?

Move to a kernel release that includes the fixing commit for its stable branch, using the commits listed in the affected ranges.Source: git.kernel.org

Is it being exploited?

Yes. CISA added it to its Known Exploited Vulnerabilities catalog on 2024-08-07, which means it has evidence of attacks. No public exploit code is tracked.Source: cisa.gov, cve.now feed data