CVE-2024-36001 (GCVE-0-2024-36001)
Vulnerability from cvelistv5
Published
2024-05-20 09:48
Modified
2026-08-05 11:31
Severity ?
VLAI Severity ?
EPSS score ?
Summary
In the Linux kernel, the following vulnerability has been resolved:
netfs: Fix the pre-flush when appending to a file in writethrough mode
In netfs_perform_write(), when the file is marked NETFS_ICTX_WRITETHROUGH
or O_*SYNC or RWF_*SYNC was specified, write-through caching is performed
on a buffered file. When setting up for write-through, we flush any
conflicting writes in the region and wait for the write to complete,
failing if there's a write error to return.
The issue arises if we're writing at or above the EOF position because we
skip the flush and - more importantly - the wait. This becomes a problem
if there's a partial folio at the end of the file that is being written out
and we want to make a write to it too. Both the already-running write and
the write we start both want to clear the writeback mark, but whoever is
second causes a warning looking something like:
------------[ cut here ]------------
R=00000012: folio 11 is not under writeback
WARNING: CPU: 34 PID: 654 at fs/netfs/write_collect.c:105
...
CPU: 34 PID: 654 Comm: kworker/u386:27 Tainted: G S ...
...
Workqueue: events_unbound netfs_write_collection_worker
...
RIP: 0010:netfs_writeback_lookup_folio
Fix this by making the flush-and-wait unconditional. It will do nothing if
there are no folios in the pagecache and will return quickly if there are
no folios in the region specified.
Further, move the WBC attachment above the flush call as the flush is going
to attach a WBC and detach it again if it is not present - and since we
need one anyway we might as well share it.
References
Impacted products
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2024-36001",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2024-05-20T14:21:51.289020Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2024-06-04T17:48:03.177Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
},
{
"providerMetadata": {
"dateUpdated": "2024-08-02T03:30:11.620Z",
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE"
},
"references": [
{
"tags": [
"x_transferred"
],
"url": "https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9"
},
{
"tags": [
"x_transferred"
],
"url": "https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5"
}
],
"title": "CVE Program Container"
}
],
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"product": "Linux",
"programFiles": [
"fs/netfs/buffered_write.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"lessThan": "5eaf23b2e81349f6614f88396dc468fda89fc0b9",
"status": "affected",
"version": "41d8e7673a7726cba57cb8112d81c89cfb6c3e35",
"versionType": "git"
},
{
"lessThan": "c97f59e276d4e93480f29a70accbd0d7273cf3f5",
"status": "affected",
"version": "41d8e7673a7726cba57cb8112d81c89cfb6c3e35",
"versionType": "git"
}
]
},
{
"defaultStatus": "affected",
"product": "Linux",
"programFiles": [
"fs/netfs/buffered_write.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"status": "affected",
"version": "6.8"
},
{
"lessThan": "6.8",
"status": "unaffected",
"version": "0",
"versionType": "semver"
},
{
"lessThanOrEqual": "6.8.*",
"status": "unaffected",
"version": "6.8.9",
"versionType": "semver"
},
{
"lessThanOrEqual": "*",
"status": "unaffected",
"version": "6.9",
"versionType": "original_commit_for_fix"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.8.9",
"versionStartIncluding": "6.8",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.9",
"versionStartIncluding": "6.8",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnetfs: Fix the pre-flush when appending to a file in writethrough mode\n\nIn netfs_perform_write(), when the file is marked NETFS_ICTX_WRITETHROUGH\nor O_*SYNC or RWF_*SYNC was specified, write-through caching is performed\non a buffered file. When setting up for write-through, we flush any\nconflicting writes in the region and wait for the write to complete,\nfailing if there\u0027s a write error to return.\n\nThe issue arises if we\u0027re writing at or above the EOF position because we\nskip the flush and - more importantly - the wait. This becomes a problem\nif there\u0027s a partial folio at the end of the file that is being written out\nand we want to make a write to it too. Both the already-running write and\nthe write we start both want to clear the writeback mark, but whoever is\nsecond causes a warning looking something like:\n\n ------------[ cut here ]------------\n R=00000012: folio 11 is not under writeback\n WARNING: CPU: 34 PID: 654 at fs/netfs/write_collect.c:105\n ...\n CPU: 34 PID: 654 Comm: kworker/u386:27 Tainted: G S ...\n ...\n Workqueue: events_unbound netfs_write_collection_worker\n ...\n RIP: 0010:netfs_writeback_lookup_folio\n\nFix this by making the flush-and-wait unconditional. It will do nothing if\nthere are no folios in the pagecache and will return quickly if there are\nno folios in the region specified.\n\nFurther, move the WBC attachment above the flush call as the flush is going\nto attach a WBC and detach it again if it is not present - and since we\nneed one anyway we might as well share it."
}
],
"metrics": [
{
"cvssV3_1": {
"baseScore": 7.8,
"baseSeverity": "HIGH",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"version": "3.1"
},
"scenarios": [
{
"lang": "en",
"value": "AV:L - The vulnerability is triggered by local write(2)/pwritev2(2)/sync_file_range(2) syscalls against a file on a mounted 9p or AFS filesystem; no remote peer can initiate the sequence on its own.\nAC:L - The attacker controls both sides of the race \u2014 sync_file_range(SYNC_FILE_RANGE_WRITE) or an async io_uring/AIO RWF_SYNC write starts writeback without waiting and without holding i_rwsem, and an immediately following O_SYNC append at EOF lands in the same tail folio; the kernel test robot reproduced it in routine stress testing.\nPR:L - Any unprivileged local user with write access to a file on an existing 9p or AFS mount can trigger this \u2014 no capabilities are required, and 9p mounts writable by ordinary users are standard in VM guests and container runtimes (QEMU virtio-9p, WSL2, crosvm, Kata/gVisor).\nUI:N - The attacker performs every step itself on its own file; no action by another user or administrator is needed.\nS:U - The corruption and the vulnerable code are both in the kernel of the machine where the attack originates, so no security authority boundary is crossed.\nC:H - Premature PG_writeback clearing lets a folio be truncated, freed and reused while the reference-free ITER_XARRAY writethrough request is still transmitting from it, so freed-and-reused kernel memory is sent to the 9p/AFS server, and the resulting UAF is a general read primitive.\nI:H - The bug yields a use-after-free on page-cache folios plus a double kfree() of struct netfs_folio and a netfs_group refcount underflow in netfs_pages_written_back(), all of which are exploitable for heap corruption and arbitrary write, in addition to silent file data corruption.\nA:H - The second completion trips WARN() in netfs_pages_written_back() (panic under panic_on_warn) and VM_BUG_ON_FOLIO() inside folio_end_writeback() under CONFIG_DEBUG_VM, and the underlying use-after-free crashes the kernel outright."
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-08-05T11:31:31.727Z",
"orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"shortName": "Linux"
},
"references": [
{
"url": "https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9"
},
{
"url": "https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5"
}
],
"title": "netfs: Fix the pre-flush when appending to a file in writethrough mode",
"x_generator": {
"engine": "bippy-1.2.0"
}
}
},
"cveMetadata": {
"assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"assignerShortName": "Linux",
"cveId": "CVE-2024-36001",
"datePublished": "2024-05-20T09:48:02.966Z",
"dateReserved": "2024-05-17T13:50:33.149Z",
"dateUpdated": "2026-08-05T11:31:31.727Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2",
"vulnerability-lookup:meta": {
"vulnrichment": {
"containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T03:30:11.620Z\"}}, {\"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-36001\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-05-20T14:21:51.289020Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-05-23T19:01:24.821Z\"}, \"title\": \"CISA ADP Vulnrichment\"}], \"cna\": {\"title\": \"netfs: Fix the pre-flush when appending to a file in writethrough mode\", \"metrics\": [{\"cvssV3_1\": {\"version\": \"3.1\", \"baseScore\": 7.8, \"baseSeverity\": \"HIGH\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"AV:L - The vulnerability is triggered by local write(2)/pwritev2(2)/sync_file_range(2) syscalls against a file on a mounted 9p or AFS filesystem; no remote peer can initiate the sequence on its own.\\nAC:L - The attacker controls both sides of the race \\u2014 sync_file_range(SYNC_FILE_RANGE_WRITE) or an async io_uring/AIO RWF_SYNC write starts writeback without waiting and without holding i_rwsem, and an immediately following O_SYNC append at EOF lands in the same tail folio; the kernel test robot reproduced it in routine stress testing.\\nPR:L - Any unprivileged local user with write access to a file on an existing 9p or AFS mount can trigger this \\u2014 no capabilities are required, and 9p mounts writable by ordinary users are standard in VM guests and container runtimes (QEMU virtio-9p, WSL2, crosvm, Kata/gVisor).\\nUI:N - The attacker performs every step itself on its own file; no action by another user or administrator is needed.\\nS:U - The corruption and the vulnerable code are both in the kernel of the machine where the attack originates, so no security authority boundary is crossed.\\nC:H - Premature PG_writeback clearing lets a folio be truncated, freed and reused while the reference-free ITER_XARRAY writethrough request is still transmitting from it, so freed-and-reused kernel memory is sent to the 9p/AFS server, and the resulting UAF is a general read primitive.\\nI:H - The bug yields a use-after-free on page-cache folios plus a double kfree() of struct netfs_folio and a netfs_group refcount underflow in netfs_pages_written_back(), all of which are exploitable for heap corruption and arbitrary write, in addition to silent file data corruption.\\nA:H - The second completion trips WARN() in netfs_pages_written_back() (panic under panic_on_warn) and VM_BUG_ON_FOLIO() inside folio_end_writeback() under CONFIG_DEBUG_VM, and the underlying use-after-free crashes the kernel outright.\"}]}], \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"41d8e7673a7726cba57cb8112d81c89cfb6c3e35\", \"lessThan\": \"5eaf23b2e81349f6614f88396dc468fda89fc0b9\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"41d8e7673a7726cba57cb8112d81c89cfb6c3e35\", \"lessThan\": \"c97f59e276d4e93480f29a70accbd0d7273cf3f5\", \"versionType\": \"git\"}], \"programFiles\": [\"fs/netfs/buffered_write.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6.8\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.8\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.8.9\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.8.*\"}, {\"status\": \"unaffected\", \"version\": \"6.9\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"fs/netfs/buffered_write.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/5eaf23b2e81349f6614f88396dc468fda89fc0b9\"}, {\"url\": \"https://git.kernel.org/stable/c/c97f59e276d4e93480f29a70accbd0d7273cf3f5\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnetfs: Fix the pre-flush when appending to a file in writethrough mode\\n\\nIn netfs_perform_write(), when the file is marked NETFS_ICTX_WRITETHROUGH\\nor O_*SYNC or RWF_*SYNC was specified, write-through caching is performed\\non a buffered file. When setting up for write-through, we flush any\\nconflicting writes in the region and wait for the write to complete,\\nfailing if there\u0027s a write error to return.\\n\\nThe issue arises if we\u0027re writing at or above the EOF position because we\\nskip the flush and - more importantly - the wait. This becomes a problem\\nif there\u0027s a partial folio at the end of the file that is being written out\\nand we want to make a write to it too. Both the already-running write and\\nthe write we start both want to clear the writeback mark, but whoever is\\nsecond causes a warning looking something like:\\n\\n ------------[ cut here ]------------\\n R=00000012: folio 11 is not under writeback\\n WARNING: CPU: 34 PID: 654 at fs/netfs/write_collect.c:105\\n ...\\n CPU: 34 PID: 654 Comm: kworker/u386:27 Tainted: G S ...\\n ...\\n Workqueue: events_unbound netfs_write_collection_worker\\n ...\\n RIP: 0010:netfs_writeback_lookup_folio\\n\\nFix this by making the flush-and-wait unconditional. It will do nothing if\\nthere are no folios in the pagecache and will return quickly if there are\\nno folios in the region specified.\\n\\nFurther, move the WBC attachment above the flush call as the flush is going\\nto attach a WBC and detach it again if it is not present - and since we\\nneed one anyway we might as well share it.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.8.9\", \"versionStartIncluding\": \"6.8\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"6.9\", \"versionStartIncluding\": \"6.8\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-08-05T11:31:31.727Z\"}}}",
"cveMetadata": "{\"cveId\": \"CVE-2024-36001\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-05T11:31:31.727Z\", \"dateReserved\": \"2024-05-17T13:50:33.149Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-20T09:48:02.966Z\", \"assignerShortName\": \"Linux\"}",
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}
}
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…
Loading…