CVE-2024-40900
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
12/07/2024
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
cachefiles: remove requests from xarray during flushing requests<br />
<br />
Even with CACHEFILES_DEAD set, we can still read the requests, so in the<br />
following concurrency the request may be used after it has been freed:<br />
<br />
mount | daemon_thread1 | daemon_thread2<br />
------------------------------------------------------------<br />
cachefiles_ondemand_init_object<br />
cachefiles_ondemand_send_req<br />
REQ_A = kzalloc(sizeof(*req) + data_len)<br />
wait_for_completion(&REQ_A->done)<br />
cachefiles_daemon_read<br />
cachefiles_ondemand_daemon_read<br />
// close dev fd<br />
cachefiles_flush_reqs<br />
complete(&REQ_A->done)<br />
kfree(REQ_A)<br />
xa_lock(&cache->reqs);<br />
cachefiles_ondemand_select_req<br />
req->msg.opcode != CACHEFILES_OP_READ<br />
// req use-after-free !!!<br />
xa_unlock(&cache->reqs);<br />
xa_destroy(&cache->reqs)<br />
<br />
Hence remove requests from cache->reqs when flushing them to avoid<br />
accessing freed requests.
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.19 (including) | 6.1.95 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.35 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.9.6 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.10:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.10:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.10:rc3:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/0fc75c5940fa634d84e64c93bfc388e1274ed013
- https://git.kernel.org/stable/c/37e19cf86a520d65de1de9cb330415c332a40d19
- https://git.kernel.org/stable/c/50d0e55356ba5b84ffb51c42704126124257e598
- https://git.kernel.org/stable/c/9f13aacdd4ee9a7644b2a3c96d67113cd083c9c7
- https://git.kernel.org/stable/c/0fc75c5940fa634d84e64c93bfc388e1274ed013
- https://git.kernel.org/stable/c/37e19cf86a520d65de1de9cb330415c332a40d19
- https://git.kernel.org/stable/c/50d0e55356ba5b84ffb51c42704126124257e598
- https://git.kernel.org/stable/c/9f13aacdd4ee9a7644b2a3c96d67113cd083c9c7
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html



