Lucene search

K
cveLinuxCVE-2024-40913
HistoryJul 12, 2024 - 1:15 p.m.

CVE-2024-40913

2024-07-1213:15:14
Linux
web.nvd.nist.gov
33
linux kernel
cachefiles
vulnerability
reference count
userland
close fd
uaf
copy_to_user
fd_install

AI Score

6.4

Confidence

Low

EPSS

0

Percentile

15.9%

In the Linux kernel, the following vulnerability has been resolved:

cachefiles: defer exposing anon_fd until after copy_to_user() succeeds

After installing the anonymous fd, we can now see it in userland and close
it. However, at this point we may not have gotten the reference count of
the cache, but we will put it during colse fd, so this may cause a cache
UAF.

So grab the cache reference count before fd_install(). In addition, by
kernel convention, fd is taken over by the user land after fd_install(),
and the kernel should not call close_fd() after that, i.e., it should call
fd_install() after everything is ready, thus fd_install() is called after
copy_to_user() succeeds.

Affected configurations

Vulners
Node
linuxlinux_kernelRange5.196.1.95
OR
linuxlinux_kernelRange6.2.06.6.35
OR
linuxlinux_kernelRange6.7.06.9.6
OR
linuxlinux_kernelRange6.10.0
VendorProductVersionCPE
linuxlinux_kernel*cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

CNA Affected

[
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "unaffected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "fs/cachefiles/ondemand.c"
    ],
    "versions": [
      {
        "version": "c8383054506c",
        "lessThan": "eac51d9daacd",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c8383054506c",
        "lessThan": "d2d3eb377a5d",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c8383054506c",
        "lessThan": "b9f58cdae6a3",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c8383054506c",
        "lessThan": "4b4391e77a6b",
        "status": "affected",
        "versionType": "git"
      }
    ]
  },
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "affected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "fs/cachefiles/ondemand.c"
    ],
    "versions": [
      {
        "version": "5.19",
        "status": "affected"
      },
      {
        "version": "0",
        "lessThan": "5.19",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.1.95",
        "lessThanOrEqual": "6.1.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.6.35",
        "lessThanOrEqual": "6.6.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.9.6",
        "lessThanOrEqual": "6.9.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.10",
        "lessThanOrEqual": "*",
        "status": "unaffected",
        "versionType": "original_commit_for_fix"
      }
    ]
  }
]

AI Score

6.4

Confidence

Low

EPSS

0

Percentile

15.9%