{"id":"CVE-2026-89841","state":"PUBLISHED","title":"f2fs: only redirty pinned folios in redirty_blocks","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: only redirty pinned folios in redirty_blocks\n\nredirty_blocks() pins folios with read_cache_folio() and then walks the\nsame range again with filemap_lock_folio() to redirty them and drop the\nreferences it took.\n\nCommit 5951fee46bef (\"f2fs: Use a folio in redirty_blocks()\") changed\nthe second pass to a do/while loop. If read_cache_folio() fails before\nanything is pinned, page_idx does not advance but the cleanup loop still\nruns once.\n\nIf readahead has already populated the failed folio in page cache, that\nextra iteration finds it and folio_put_refs(folio, 2) drops one\nreference too many. Later drop_caches or reclaim can then report\n\"BUG: Bad page state\".\n\nOnly redirty the range that was pinned successfully.","publishedAt":"2026-09-16T10:31:15.578Z","updatedAt":"2026-10-19T08:53:34.362Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5951fee46befbf6176c86482432f4f76e522f16c","status":"affected","lessThan":"445e4a1e6025ecd5312e9a95c1b234192c976ca1","versionType":"git"},{"version":"5951fee46befbf6176c86482432f4f76e522f16c","status":"affected","lessThan":"89c65ec3c18903de763cf567c96ab3ef60e5f3b0","versionType":"git"},{"version":"5951fee46befbf6176c86482432f4f76e522f16c","status":"affected","lessThan":"85171332742e741ccd6f401c69b6e0d698119e72","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/f2fs/file.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.16","versionType":"semver"},{"version":"6.18.51","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.5","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/f2fs/file.c"]}],"references":["https://git.kernel.org/stable/c/445e4a1e6025ecd5312e9a95c1b234192c976ca1","https://git.kernel.org/stable/c/89c65ec3c18903de763cf567c96ab3ef60e5f3b0","https://git.kernel.org/stable/c/85171332742e741ccd6f401c69b6e0d698119e72"],"weaknesses":[],"ingestedAt":"2026-10-29T20:13:26.108Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/89xxx/CVE-2026-89841.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-89841","state":"PUBLISHED","datePublished":"2026-09-16T10:31:15.578Z","dateUpdated":"2026-10-19T08:53:34.362Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-11T19:38:34.770Z"},"containers":{"cna":{"title":"f2fs: only redirty pinned folios in redirty_blocks","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: only redirty pinned folios in redirty_blocks\n\nredirty_blocks() pins folios with read_cache_folio() and then walks the\nsame range again with filemap_lock_folio() to redirty them and drop the\nreferences it took.\n\nCommit 5951fee46bef (\"f2fs: Use a folio in redirty_blocks()\") changed\nthe second pass to a do/while loop. If read_cache_folio() fails before\nanything is pinned, page_idx does not advance but the cleanup loop still\nruns once.\n\nIf readahead has already populated the failed folio in page cache, that\nextra iteration finds it and folio_put_refs(folio, 2) drops one\nreference too many. Later drop_caches or reclaim can then report\n\"BUG: Bad page state\".\n\nOnly redirty the range that was pinned successfully."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5951fee46befbf6176c86482432f4f76e522f16c","status":"affected","lessThan":"445e4a1e6025ecd5312e9a95c1b234192c976ca1","versionType":"git"},{"version":"5951fee46befbf6176c86482432f4f76e522f16c","status":"affected","lessThan":"89c65ec3c18903de763cf567c96ab3ef60e5f3b0","versionType":"git"},{"version":"5951fee46befbf6176c86482432f4f76e522f16c","status":"affected","lessThan":"85171332742e741ccd6f401c69b6e0d698119e72","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/f2fs/file.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.16","versionType":"semver"},{"version":"6.18.51","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2.5","status":"unaffected","lessThanOrEqual":"7.2.*","versionType":"semver"},{"version":"7.3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/f2fs/file.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/445e4a1e6025ecd5312e9a95c1b234192c976ca1"},{"url":"https://git.kernel.org/stable/c/89c65ec3c18903de763cf567c96ab3ef60e5f3b0"},{"url":"https://git.kernel.org/stable/c/85171332742e741ccd6f401c69b6e0d698119e72"}],"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 - redirty_blocks() is reached only via local F2FS_IOC_COMPRESS_FILE/F2FS_IOC_DECOMPRESS_FILE ioctls (f2fs_ioctl → f2fs_ioc_{compress,decompress}_file) on a mounted f2fs file; these are not network, Bluetooth, or USB protocol handlers.\nAC:L - The attacker drives the ioctl and can force the first read_cache_folio() to fail (memcg/ENOMEM, or a fatal signal during the killable wait after readahead inserted the folio), so the do/while cleanup always runs once; no victim-timed race or layout outside their control is required.\nPR:L - Neither ioctl checks capable()/CAP_SYS_ADMIN; they need only a writable fd (FMODE_WRITE) of a compression-enabled file, and owners can set FS_COMPR_FL via FS_IOC_SETFLAGS/chattr +c on Android/embedded f2fs userdata with compress_mode=user.\nUI:N - On typical f2fs deployments (Android userdata already mounted with compression/compress_mode=user) the attacker creates or opens their own file and issues the ioctl with no victim mount, open, or other action.\nS:U - Page-cache refcount underflow and the resulting kernel oops stay inside the host kernel's security authority; this is not a VM guest-to-host escape, IOMMU bypass, or sandbox breakout.\nC:H - The extra folio_put_refs(folio, 2) drops the page-cache reference and can free a folio still indexed in mapping->i_pages; that use-after-free of page-cache memory is a read primitive for arbitrary kernel/user data.\nI:H - The same underflow lets the freed folio be reused while still in the mapping (the stray pass also dirties and unlocks it), yielding a write primitive usable for control-flow hijack.\nA:H - If the folio is absent, filemap_lock_folio() returns ERR_PTR(-ENOENT) and production f2fs_bug_on() WARNs then dereferences it (oops); the extra-put path reports BUG: Bad page state on reclaim/drop_caches and can panic."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-19T08:53:34.362Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.16","versionEndExcluding":"6.18.51"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.16","versionEndExcluding":"7.2.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.16","versionEndExcluding":"7.3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}