CVE-2024-41050
Severity CVSS v4.0:
Pending analysis
Type:
CWE-416
Use After Free
Publication date:
29/07/2024
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
cachefiles: cyclic allocation of msg_id to avoid reuse<br />
<br />
Reusing the msg_id after a maliciously completed reopen request may cause<br />
a read request to remain unprocessed and result in a hung, as shown below:<br />
<br />
t1 | t2 | t3<br />
-------------------------------------------------<br />
cachefiles_ondemand_select_req<br />
cachefiles_ondemand_object_is_close(A)<br />
cachefiles_ondemand_set_object_reopening(A)<br />
queue_work(fscache_object_wq, &info->work)<br />
ondemand_object_worker<br />
cachefiles_ondemand_init_object(A)<br />
cachefiles_ondemand_send_req(OPEN)<br />
// get msg_id 6<br />
wait_for_completion(&req_A->done)<br />
cachefiles_ondemand_daemon_read<br />
// read msg_id 6 req_A<br />
cachefiles_ondemand_get_fd<br />
copy_to_user<br />
// Malicious completion msg_id 6<br />
copen 6,-1<br />
cachefiles_ondemand_copen<br />
complete(&req_A->done)<br />
// will not set the object to close<br />
// because ondemand_id && fd is valid.<br />
<br />
// ondemand_object_worker() is done<br />
// but the object is still reopening.<br />
<br />
// new open req_B<br />
cachefiles_ondemand_init_object(B)<br />
cachefiles_ondemand_send_req(OPEN)<br />
// reuse msg_id 6<br />
process_open_req<br />
copen 6,A.size<br />
// The expected failed copen was executed successfully<br />
<br />
Expect copen to fail, and when it does, it closes fd, which sets the<br />
object to close, and then close triggers reopen again. However, due to<br />
msg_id reuse resulting in a successful copen, the anonymous fd is not<br />
closed until the daemon exits. Therefore read requests waiting for reopen<br />
to complete may trigger hung task.<br />
<br />
To avoid this issue, allocate the msg_id cyclically to avoid reusing the<br />
msg_id for a very short duration of time.
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.100 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.41 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.9.10 (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:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.10:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.10:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.10:rc6:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.10:rc7:*:*:*:*:*:* |
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/19f4f399091478c95947f6bd7ad61622300c30d9
- https://git.kernel.org/stable/c/35710c6c4a1c64478ec1b5e0e81d386c0844dec6
- https://git.kernel.org/stable/c/9d3bf4e9aa23f0d9e99ebe7a94f232ddba54ee17
- https://git.kernel.org/stable/c/de045a82e1a4e04be62718d3c2981a55150765a0
- https://git.kernel.org/stable/c/19f4f399091478c95947f6bd7ad61622300c30d9
- https://git.kernel.org/stable/c/35710c6c4a1c64478ec1b5e0e81d386c0844dec6
- https://git.kernel.org/stable/c/9d3bf4e9aa23f0d9e99ebe7a94f232ddba54ee17
- https://git.kernel.org/stable/c/de045a82e1a4e04be62718d3c2981a55150765a0
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html



