CVE-2024-41051: cachefiles: wait for ondemand_object_worker to finish when dropping object
In the Linux kernel, the following vulnerability has been resolved:
cachefiles: wait for ondemandobjectworker to finish when dropping object
When queuing ondemandobjectworker() to re-open the object, cachefilesobject is not pinned. The cachefilesobject may be freed when the pending read request is completed intentionally and the related erofs is umounted. If ondemandobjectworker() runs after the object is freed, it will incur use-after-free problem as shown below.
process A processs B process C process D
cachefilesondemandsendreq() // send a read req X // wait for its completion
// close ondemand fd cachefilesondemandfdrelease() // set object as CLOSE
cachefilesondemanddaemonread() // set object as REOPENING queuework(fscachewq, &info->ondemandwork)
// close /dev/cachefiles cachefilesdaemonrelease cachefilesflushreqs complete(&req->done)
// read req X is completed // umount the erofs fs cachefilesputobject() // object will be freed cachefilesondemanddeinitobjinfo() kmemcachefree(object) // both info and object are freed ondemandobjectworker()
When dropping an object, it is no longer necessary to reopen the object, so use cancelworksync() to cancel or wait for ondemandobjectworker() to finish.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.22-1Fixed in 6.12.25-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.129-1~deb11u1
Event History
Frequently Asked Questions
What is the severity of CVE-2024-41051?
CVE-2024-41051 is classified as a moderate severity vulnerability in the Linux kernel.
How do I fix CVE-2024-41051?
To fix CVE-2024-41051, upgrade to the patched versions of the Linux kernel, specifically 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.128-1, 6.12.12-1, 6.12.15-1, or 6.1.128-1~deb11u1.
What impact does CVE-2024-41051 have on affected systems?
CVE-2024-41051 can potentially lead to a denial of service by freeing a cachefiles_object unexpectedly.
Which Linux kernel versions are affected by CVE-2024-41051?
Affected Linux kernel versions include those prior to the fixed releases enumerated in the mitigation.
Is CVE-2024-41051 a remote or local vulnerability?
CVE-2024-41051 is considered a local vulnerability as it requires local access to exploit.