Lucene search

K
cvelistLinuxCVELIST:CVE-2024-36971
HistoryJun 10, 2024 - 9:03 a.m.

CVE-2024-36971 net: fix __dst_negative_advice() race

2024-06-1009:03:23
Linux
www.cve.org
2
linux kernel
cve-2024-36971
vulnerability
fix
net
race
uaf
rcu rules
dst_cache
protocol
ip6_negative_advice
rtf_cache
udp sockets

0.0004 Low

EPSS

Percentile

5.1%

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.

CNA Affected

[
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "unaffected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "include/net/dst_ops.h",
      "include/net/sock.h",
      "net/ipv4/route.c",
      "net/ipv6/route.c",
      "net/xfrm/xfrm_policy.c"
    ],
    "versions": [
      {
        "version": "a87cb3e48ee8",
        "lessThan": "051c0bde9f04",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "a87cb3e48ee8",
        "lessThan": "db0082825037",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "a87cb3e48ee8",
        "lessThan": "2295a7ef5c8c",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "a87cb3e48ee8",
        "lessThan": "eacb8b195579",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "a87cb3e48ee8",
        "lessThan": "81dd3c82a456",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "a87cb3e48ee8",
        "lessThan": "5af198c38712",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "a87cb3e48ee8",
        "lessThan": "b8af8e6118a6",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "a87cb3e48ee8",
        "lessThan": "92f1655aa2b2",
        "status": "affected",
        "versionType": "git"
      }
    ]
  },
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "affected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "include/net/dst_ops.h",
      "include/net/sock.h",
      "net/ipv4/route.c",
      "net/ipv6/route.c",
      "net/xfrm/xfrm_policy.c"
    ],
    "versions": [
      {
        "version": "4.6",
        "status": "affected"
      },
      {
        "version": "0",
        "lessThan": "4.6",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "4.19.316",
        "lessThanOrEqual": "4.19.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.4.278",
        "lessThanOrEqual": "5.4.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.10.219",
        "lessThanOrEqual": "5.10.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.15.161",
        "lessThanOrEqual": "5.15.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.1.94",
        "lessThanOrEqual": "6.1.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.6.34",
        "lessThanOrEqual": "6.6.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.9.4",
        "lessThanOrEqual": "6.9.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.10-rc2",
        "lessThanOrEqual": "*",
        "status": "unaffected",
        "versionType": "original_commit_for_fix"
      }
    ]
  }
]

0.0004 Low

EPSS

Percentile

5.1%