Lucene search

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

CVE-2024-40900

2024-07-1213:15:13
Linux
web.nvd.nist.gov
32
linux kernel
vulnerability
cachefiles

AI Score

6.5

Confidence

Low

EPSS

0

Percentile

15.9%

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

cachefiles: remove requests from xarray during flushing requests

Even with CACHEFILES_DEAD set, we can still read the requests, so in the
following concurrency the request may be used after it has been freed:

 mount  |   daemon_thread1    |    daemon_thread2

cachefiles_ondemand_init_object
cachefiles_ondemand_send_req
REQ_A = kzalloc(sizeof(*req) + data_len)
wait_for_completion(&REQ_A->done)
cachefiles_daemon_read
cachefiles_ondemand_daemon_read
// close dev fd
cachefiles_flush_reqs
complete(&REQ_A->done)
kfree(REQ_A)
xa_lock(&cache->reqs);
cachefiles_ondemand_select_req
req->msg.opcode != CACHEFILES_OP_READ
// req use-after-free !!!
xa_unlock(&cache->reqs);
xa_destroy(&cache->reqs)

Hence remove requests from cache->reqs when flushing them to avoid
accessing freed requests.

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/daemon.c"
    ],
    "versions": [
      {
        "version": "c8383054506c",
        "lessThan": "9f13aacdd4ee",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c8383054506c",
        "lessThan": "50d0e55356ba",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c8383054506c",
        "lessThan": "37e19cf86a52",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "c8383054506c",
        "lessThan": "0fc75c5940fa",
        "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/daemon.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.5

Confidence

Low

EPSS

0

Percentile

15.9%