cachefiles: flush all requests after setting CACHEFILES_DEAD
In the Linux kernel, the following vulnerability has been resolved: cachefiles: flush all requests after setting CACHEFILES_DEAD In ondemand mode, when the daemon is processing an open request, if the kernel flags the cache as CACHEFILES_DEAD, the cachefiles_daemon_write() will always return -EIO, so the daemon can't pass the copen to the kernel. Then the kernel process that is waiting for the copen triggers a hung_task. Since the DEAD state is irreversible, it can only be exited by closing /dev/cachefiles. Therefore, after calling cachefiles_io_error() to mark the cache as CACHEFILES_DEAD, if in ondemand mode, flush all requests to avoid the above hungtask. We may still be able to read some of the cached data before closing the fd of /dev/cachefiles. Note that this relies on the patch that adds reference counting to the req, otherwise it may UAF.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 6.1.95, 6.6.35, 6.9.6
- CVEs
- CVE-2024-40935
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 3 Nov 2026, 13:43 UTC · Revision 1
Source evidence
cachefiles: flush all requests after setting CACHEFILES_DEAD
core-osv · Original sourcePublished 12 Jul 2024, 12:25 UTC
In the Linux kernel, the following vulnerability has been resolved: cachefiles: flush all requests after setting CACHEFILES_DEAD In ondemand mode, when the daemon is processing an open request, if the kernel flags the cache as CACHEFILES_DEAD, the cachefiles_daemon_write() will always return -EIO, so the daemon can't pass the copen to the kernel. Then the kernel process that is waiting for the copen triggers a hung_task. Since the DEAD state is irreversible, it can only be exited by closing /dev/cachefiles. Therefore, after calling cachefiles_io_error() to mark the cache as CACHEFILES_DEAD, if in ondemand mode, flush all requests to avoid the above hungtask. We may still be able to read some of the cached data before closing the fd of /dev/cachefiles. Note that this relies on the patch that adds reference counting to the req, otherwise it may UAF.
osv:CVE-2024-40935
Kernel
Fixed versions: 6.1.95, 6.6.35, 6.9.6
Complete source record
{
"id": "83a8a11ebc99f0f0cef6dce179d23f708f192e1b480749fb55d0b2f6c240beb1",
"url": "https://osv.dev/vulnerability/CVE-2024-40935",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "cachefiles: flush all requests after setting CACHEFILES_DEAD",
"summary": "In the Linux kernel, the following vulnerability has been resolved: cachefiles: flush all requests after setting CACHEFILES_DEAD In ondemand mode, when the daemon is processing an open request, if the kernel flags the cache as CACHEFILES_DEAD, the cachefiles_daemon_write() will always return -EIO, so the daemon can't pass the copen to the kernel. Then the kernel process that is waiting for the copen triggers a hung_task. Since the DEAD state is irreversible, it can only be exited by closing /dev/cachefiles. Therefore, after calling cachefiles_io_error() to mark the cache as CACHEFILES_DEAD, if in ondemand mode, flush all requests to avoid the above hungtask. We may still be able to read some of the cached data before closing the fd of /dev/cachefiles. Note that this relies on the patch that adds reference counting to the req, otherwise it may UAF.",
"evidence": "osv:CVE-2024-40935",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "6.1.95",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.35",
"evidence": "/affected/1/ranges"
},
{
"value": "6.9.6",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2024-40935",
"aliases": [
"CVE-2024-40935"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "c8383054506c77b814489c09877b5db83fd4abf2"
},
{
"fixed": "320ba9cbca78be79c912143bbba1d1b35ca55cf0"
},
{
"fixed": "3bf0b8030296e9ee60d3d4c15849ad9ac0b47081"
},
{
"fixed": "e73fac95084839c5178d97e81c6a2051251bdc00"
},
{
"fixed": "85e833cd7243bda7285492b0653c3abb1e2e757b"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-40935.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.19.0"
},
{
"fixed": "6.1.95"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.35"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.9.6"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-40935.json"
}
}
],
"modified": "2026-10-28T02:30:29.400622185Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/320ba9cbca78be79c912143bbba1d1b35ca55cf0",
"https://git.kernel.org/stable/c/3bf0b8030296e9ee60d3d4c15849ad9ac0b47081",
"https://git.kernel.org/stable/c/85e833cd7243bda7285492b0653c3abb1e2e757b",
"https://git.kernel.org/stable/c/e73fac95084839c5178d97e81c6a2051251bdc00",
"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40935.json",
"https://nvd.nist.gov/vuln/detail/CVE-2024-40935",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40935.json"
}
},
"related_cves": [
{
"value": "CVE-2024-40935",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 496039,
"published_at": "2024-07-12T12:25:12.483+00:00"
}