{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2024-40900", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2024-07-12T12:17:45.579Z", "datePublished": "2024-07-12T12:20:42.192Z", "dateUpdated": "2026-08-05T11:33:52.424Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-08-05T11:33:52.424Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ncachefiles: remove requests from xarray during flushing requests\n\nEven with CACHEFILES_DEAD set, we can still read the requests, so in the\nfollowing concurrency the request may be used after it has been freed:\n\n mount | daemon_thread1 | daemon_thread2\n------------------------------------------------------------\n cachefiles_ondemand_init_object\n cachefiles_ondemand_send_req\n REQ_A = kzalloc(sizeof(*req) + data_len)\n wait_for_completion(&REQ_A->done)\n cachefiles_daemon_read\n cachefiles_ondemand_daemon_read\n // close dev fd\n cachefiles_flush_reqs\n complete(&REQ_A->done)\n kfree(REQ_A)\n xa_lock(&cache->reqs);\n cachefiles_ondemand_select_req\n req->msg.opcode != CACHEFILES_OP_READ\n // req use-after-free !!!\n xa_unlock(&cache->reqs);\n xa_destroy(&cache->reqs)\n\nHence remove requests from cache->reqs when flushing them to avoid\naccessing freed requests." } ], "metrics": [ { "cvssV3_1": { "version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH" }, "scenarios": [ { "lang": "en", "value": "AV:L - The vulnerability is reached through local file access on an erofs/fscache on-demand mount and `read()` on the `/dev/cachefiles` character device; no network or adjacent-network data path is involved.\nAC:L - The attacker controls all sides of the race — pending requests are created on demand by repeated reads of uncached ranges, the flush is inducible via cache-backing I/O errors or daemon teardown, and the daemon's `read()` loop is permanently armed by design, so the window can be hit repeatedly with retries costing nothing.\nPR:L - An unprivileged local user on a host using erofs-on-demand (container lazy image loading) supplies the freed request by reading cached files and sprays the freed slab slot; the CAP_SYS_ADMIN daemon is the victim racer running by design, not a capability the attacker needs.\nUI:N - No victim action is required — the cachefiles daemon is already blocked in `read()` on `/dev/cachefiles` as part of normal operation, and the flush is triggered by the attacker's own activity or routine daemon teardown.\nS:U - The corruption and its consequences are confined to the kernel's own security authority; this is a standard local kernel compromise with no VM, IOMMU, or hypervisor boundary crossed.\nC:H - The freed `cachefiles_req` is re-read and `copy_to_user(_buffer, msg, msg->len)` copies freed-slab contents to userspace with a length taken from the freed object, and the controlled `req->object` pointer chain yields further arbitrary kernel reads.\nI:H - After heap-spraying the freed allocation, `cachefiles_ondemand_set_object_reopening(object)` writes through the attacker-controlled pointer and `queue_work(fscache_wq, &info->ondemand_work)` executes a `work_struct.func` at an attacker-chosen address, giving arbitrary write and control-flow hijack.\nA:H - The slab use-after-free reliably oopses the kernel — KASAN-confirmed slab-use-after-free with a wild pointer dereference in the daemon read path — and can be retriggered at will, panicking the system." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "fs/cachefiles/daemon.c" ], "versions": [ { "version": "c8383054506c77b814489c09877b5db83fd4abf2", "lessThan": "9f13aacdd4ee9a7644b2a3c96d67113cd083c9c7", "status": "affected", "versionType": "git" }, { "version": "c8383054506c77b814489c09877b5db83fd4abf2", "lessThan": "50d0e55356ba5b84ffb51c42704126124257e598", "status": "affected", "versionType": "git" }, { "version": "c8383054506c77b814489c09877b5db83fd4abf2", "lessThan": "37e19cf86a520d65de1de9cb330415c332a40d19", "status": "affected", "versionType": "git" }, { "version": "c8383054506c77b814489c09877b5db83fd4abf2", "lessThan": "0fc75c5940fa634d84e64c93bfc388e1274ed013", "status": "affected", "versionType": "git" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "fs/cachefiles/daemon.c" ], "versions": [ { "version": "5.19", "status": "affected" }, { "version": "0", "lessThan": "5.19", "status": "unaffected", "versionType": "semver" }, { "version": "6.1.95", "lessThanOrEqual": "6.1.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.6.35", "lessThanOrEqual": "6.6.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.9.6", "lessThanOrEqual": "6.9.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.10", "lessThanOrEqual": "*", "status": "unaffected", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.19", "versionEndExcluding": "6.1.95" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.19", "versionEndExcluding": "6.6.35" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.19", "versionEndExcluding": "6.9.6" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.19", "versionEndExcluding": "6.10" } ] } ] } ], "references": [ { "url": "https://git.kernel.org/stable/c/9f13aacdd4ee9a7644b2a3c96d67113cd083c9c7" }, { "url": "https://git.kernel.org/stable/c/50d0e55356ba5b84ffb51c42704126124257e598" }, { "url": "https://git.kernel.org/stable/c/37e19cf86a520d65de1de9cb330415c332a40d19" }, { "url": "https://git.kernel.org/stable/c/0fc75c5940fa634d84e64c93bfc388e1274ed013" } ], "title": "cachefiles: remove requests from xarray during flushing requests", "x_generator": { "engine": "bippy-1.2.0" } }, "adp": [ { "title": "CVE Program Container", "references": [ { "url": "https://git.kernel.org/stable/c/9f13aacdd4ee9a7644b2a3c96d67113cd083c9c7", "tags": [ "x_transferred" ] }, { "url": "https://git.kernel.org/stable/c/50d0e55356ba5b84ffb51c42704126124257e598", "tags": [ "x_transferred" ] }, { "url": "https://git.kernel.org/stable/c/37e19cf86a520d65de1de9cb330415c332a40d19", "tags": [ "x_transferred" ] }, { "url": "https://git.kernel.org/stable/c/0fc75c5940fa634d84e64c93bfc388e1274ed013", "tags": [ "x_transferred" ] }, { "url": "https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html" } ], "providerMetadata": { "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE", "dateUpdated": "2025-11-03T21:57:27.388Z" } }, { "metrics": [ { "other": { "type": "ssvc", "content": { "id": "CVE-2024-40900", "role": "CISA Coordinator", "options": [ { "Exploitation": "none" }, { "Automatable": "no" }, { "Technical Impact": "partial" } ], "version": "2.0.3", "timestamp": "2024-09-10T17:06:34.508297Z" } } } ], "title": "CISA ADP Vulnrichment", "providerMetadata": { "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "shortName": "CISA-ADP", "dateUpdated": "2024-09-11T17:34:38.653Z" } } ] } }