{"id":"CVE-2026-98844","title":"netfs: clear post-EOF pagecache when extending a file via write","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetfs: clear post-EOF pagecache when extending a file via write\n\nFix netfs to erase the contents of a hole created after the EOF by an\nordinary write if dirty data has …","severity":"none","vendor":"Linux","product":"Linux","affected":["Linux >= 153a9961b551101cd38e94e26cd92fbfd198b19b < f8f7d86b3537e885ee620898a38b749fba8a8456","Linux >= 153a9961b551101cd38e94e26cd92fbfd198b19b < 98f6a4589e0f5f6cf819b8dd45605efc481c06ce","Linux >= 153a9961b551101cd38e94e26cd92fbfd198b19b < a7036a73671fc83d299bc770710fe996d9fef9ca","Linux >= 153a9961b551101cd38e94e26cd92fbfd198b19b < 69bf14300b50631e7c2271289d347bbd1b19a06c","Linux 6.8"],"published":"2026-10-18","updated":"2026-10-18","sourceUpdated":"2026-10-18T15:50:25.256Z","source":"CVEORG","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-98844","references":[{"url":"https://git.kernel.org/stable/c/f8f7d86b3537e885ee620898a38b749fba8a8456"},{"url":"https://git.kernel.org/stable/c/98f6a4589e0f5f6cf819b8dd45605efc481c06ce"},{"url":"https://git.kernel.org/stable/c/a7036a73671fc83d299bc770710fe996d9fef9ca"},{"url":"https://git.kernel.org/stable/c/69bf14300b50631e7c2271289d347bbd1b19a06c"}],"tags":["cve.org"],"ingestedAt":"2026-10-18T16:47:32.465Z","slug":"CVE-2026-98844","body":"## Overview\n\nIn the Linux kernel, the following vulnerability has been resolved:\n\nnetfs: clear post-EOF pagecache when extending a file via write\n\nFix netfs to erase the contents of a hole created after the EOF by an\nordinary write if dirty data has been previously left there by writes\nthrough an mmapped region.  Neither the buffered nor the unbuffered/DIO\nwrite path clears that stale pagecache.\n\nZero the tail of the folio straddling the EOF before an extending\nwrite.  That is the only folio that can hold data written past the EOF\nthrough an mmap, as pages wholly beyond the EOF can't be faulted in.\nThe folio is zeroed rather than dropped so a concurrent extending write\ncan't lose data.\n\nBoth write paths downgrade the i_rwsem to shared, so extending writes\ncan run concurrently and the i_size read by the caller may be stale by\nthe time the folio is locked.  Re-read i_size under the folio lock and\nclamp the zeroed range up to it, so a racing write that already put\ndata into the folio isn't clobbered.\n\nWait for any writeback on the folio to finish before zeroing it so that\nthe pagecache isn't modified while it may still be read by the transport\nduring transmission.  Honour IOCB_NOWAIT by returning -EAGAIN rather\nthan blocking on the folio lock, on writeback, or in folio_mkclean()'s\nrmap walk when the folio is mapped.\n\ntruncate_pagecache() can't be used here: it must be called with the\ni_rwsem held exclusively, but these write paths only hold it shared,\nand it would block unconditionally, breaking IOCB_NOWAIT.\n\nCallers that hold i_rwsem exclusively for the whole resize (truncate,\nsetattr, fallocate, clone) exclude any genuine concurrent buffered\nwriter, so staleness can instead be decided from the folio's dirty\nstate, as pagecache_isize_extended() already does for filesystems that\nserialise writes against truncate/setattr via a single i_rwsem.\nExport netfs_clear_stale_post_isize() helper to handle such case.\n\nThe helper is required by the CIFS client to fix generic/363.\n\n## Affected\n\n- `Linux >= 153a9961b551101cd38e94e26cd92fbfd198b19b < f8f7d86b3537e885ee620898a38b749fba8a8456`\n- `Linux >= 153a9961b551101cd38e94e26cd92fbfd198b19b < 98f6a4589e0f5f6cf819b8dd45605efc481c06ce`\n- `Linux >= 153a9961b551101cd38e94e26cd92fbfd198b19b < a7036a73671fc83d299bc770710fe996d9fef9ca`\n- `Linux >= 153a9961b551101cd38e94e26cd92fbfd198b19b < 69bf14300b50631e7c2271289d347bbd1b19a06c`\n- `Linux 6.8`\n\n## Remediation\n\nRefer to the linked advisories for vendor-supplied fixes and affected version ranges.","depth":"sunlit","depthScore":3,"depthScoreParts":{"impact":2.8,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}