{"id":"CVE-2024-40935","summary":"cachefiles: flush all requests after setting CACHEFILES_DEAD","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ncachefiles: flush all requests after setting CACHEFILES_DEAD\n\nIn ondemand mode, when the daemon is processing an open request, if the\nkernel flags the cache as CACHEFILES_DEAD, the cachefiles_daemon_write()\nwill always return -EIO, so the daemon can't pass the copen to the kernel.\nThen the kernel process that is waiting for the copen triggers a hung_task.\n\nSince the DEAD state is irreversible, it can only be exited by closing\n/dev/cachefiles. Therefore, after calling cachefiles_io_error() to mark\nthe cache as CACHEFILES_DEAD, if in ondemand mode, flush all requests to\navoid the above hungtask. We may still be able to read some of the cached\ndata before closing the fd of /dev/cachefiles.\n\nNote that this relies on the patch that adds reference counting to the req,\notherwise it may UAF.","modified":"2026-03-20T12:37:24.593405Z","published":"2024-07-12T12:25:12.483Z","related":["SUSE-SU-2024:2802-1","SUSE-SU-2024:2894-1","SUSE-SU-2024:2896-1","SUSE-SU-2024:2939-1","SUSE-SU-2024:2947-1","SUSE-SU-2024:2973-1","SUSE-SU-2025:20008-1","SUSE-SU-2025:20028-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40935.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/320ba9cbca78be79c912143bbba1d1b35ca55cf0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3bf0b8030296e9ee60d3d4c15849ad9ac0b47081"},{"type":"WEB","url":"https://git.kernel.org/stable/c/85e833cd7243bda7285492b0653c3abb1e2e757b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e73fac95084839c5178d97e81c6a2051251bdc00"},{"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/40xxx/CVE-2024-40935.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-40935"},{"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":"c8383054506c77b814489c09877b5db83fd4abf2"},{"fixed":"320ba9cbca78be79c912143bbba1d1b35ca55cf0"},{"fixed":"3bf0b8030296e9ee60d3d4c15849ad9ac0b47081"},{"fixed":"e73fac95084839c5178d97e81c6a2051251bdc00"},{"fixed":"85e833cd7243bda7285492b0653c3abb1e2e757b"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-40935.json"}}],"schema_version":"1.7.5"}