{"id":"CVE-2024-41051","summary":"cachefiles: wait for ondemand_object_worker to finish when dropping object","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ncachefiles: wait for ondemand_object_worker to finish when dropping object\n\nWhen queuing ondemand_object_worker() to re-open the object,\ncachefiles_object is not pinned. The cachefiles_object may be freed when\nthe pending read request is completed intentionally and the related\nerofs is umounted. If ondemand_object_worker() runs after the object is\nfreed, it will incur use-after-free problem as shown below.\n\nprocess A  processs B  process C  process D\n\ncachefiles_ondemand_send_req()\n// send a read req X\n// wait for its completion\n\n           // close ondemand fd\n           cachefiles_ondemand_fd_release()\n           // set object as CLOSE\n\n                       cachefiles_ondemand_daemon_read()\n                       // set object as REOPENING\n                       queue_work(fscache_wq, &info-\u003eondemand_work)\n\n                                // close /dev/cachefiles\n                                cachefiles_daemon_release\n                                cachefiles_flush_reqs\n                                complete(&req-\u003edone)\n\n// read req X is completed\n// umount the erofs fs\ncachefiles_put_object()\n// object will be freed\ncachefiles_ondemand_deinit_obj_info()\nkmem_cache_free(object)\n                       // both info and object are freed\n                       ondemand_object_worker()\n\nWhen dropping an object, it is no longer necessary to reopen the object,\nso use cancel_work_sync() to cancel or wait for ondemand_object_worker()\nto finish.","modified":"2026-04-16T04:36:29.416898524Z","published":"2024-07-29T14:32:07.577Z","related":["SUSE-SU-2024:3194-1","SUSE-SU-2024:3195-1","SUSE-SU-2024:3383-1","SUSE-SU-2025:20044-1","SUSE-SU-2025:20047-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/41xxx/CVE-2024-41051.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/12e009d60852f7bce0afc373ca0b320f14150418"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b26525b2183632f16a3a4108fe6a4bfa8afac6ed"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d3179bae72b1b5e555ba839d6d9f40a350a4d78a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ec9289369259d982e735a71437e32e6b4035290c"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/41xxx/CVE-2024-41051.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-41051"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"f17443d52d805c9a7fab5e67a4e8b973626fe1cd"},{"fixed":"ec9289369259d982e735a71437e32e6b4035290c"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"f740fd943bb1fbf79b7eaba3c71eb7536f437f51"},{"fixed":"d3179bae72b1b5e555ba839d6d9f40a350a4d78a"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"0a7e54c1959c0feb2de23397ec09c7692364313e"},{"fixed":"b26525b2183632f16a3a4108fe6a4bfa8afac6ed"},{"fixed":"12e009d60852f7bce0afc373ca0b320f14150418"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-41051.json"}}],"schema_version":"1.7.5"}