{"id":"CVE-2025-21811","state":"PUBLISHED","title":"nilfs2: protect access to buffers with no active references","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: protect access to buffers with no active references\n\nnilfs_lookup_dirty_data_buffers(), which iterates through the buffers\nattached to dirty data folios/pages, accesses the attached buffers without\nlocking the folios/pages.\n\nFor data cache, nilfs_clear_folio_dirty() may be called asynchronously\nwhen the file system degenerates to read only, so\nnilfs_lookup_dirty_data_buffers() still has the potential to cause use\nafter free issues when buffers lose the protection of their dirty state\nmidway due to this asynchronous clearing and are unintentionally freed by\ntry_to_free_buffers().\n\nEliminate this race issue by adjusting the lock section in this function.","publishedAt":"2025-02-27T20:01:02.256Z","updatedAt":"2026-08-05T11:54:38.930Z","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":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"e1fc4a90a90ea8514246c45435662531975937d9","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"72cf688d0ce7e642b12ddc9b2a42524737ec1b4a","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"d8ff250e085a4c4cdda4ad1cdd234ed110393143","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"58c27fa7a610b6e8d44e6220e7dbddfbaccaf439","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"8e1b9201c9a24638cf09c6e1c9f224157328010b","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"4b08d23d7d1917bef4fbee8ad81372f49b006656","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"c437dfac9f7a5a46ac2a5e6d6acd3059e9f68188","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"367a9bffabe08c04f6d725032cce3d891b2b9e1a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/segment.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.10","versionType":"semver"},{"version":"5.4.291","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.235","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.179","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.129","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.76","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.13","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.2","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/segment.c"]}],"references":["https://git.kernel.org/stable/c/e1fc4a90a90ea8514246c45435662531975937d9","https://git.kernel.org/stable/c/72cf688d0ce7e642b12ddc9b2a42524737ec1b4a","https://git.kernel.org/stable/c/d8ff250e085a4c4cdda4ad1cdd234ed110393143","https://git.kernel.org/stable/c/58c27fa7a610b6e8d44e6220e7dbddfbaccaf439","https://git.kernel.org/stable/c/8e1b9201c9a24638cf09c6e1c9f224157328010b","https://git.kernel.org/stable/c/4b08d23d7d1917bef4fbee8ad81372f49b006656","https://git.kernel.org/stable/c/c437dfac9f7a5a46ac2a5e6d6acd3059e9f68188","https://git.kernel.org/stable/c/367a9bffabe08c04f6d725032cce3d891b2b9e1a","https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html","https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:08:39.238Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21811.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21811","state":"PUBLISHED","datePublished":"2025-02-27T20:01:02.256Z","dateUpdated":"2026-08-05T11:54:38.930Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.772Z"},"containers":{"cna":{"title":"nilfs2: protect access to buffers with no active references","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: protect access to buffers with no active references\n\nnilfs_lookup_dirty_data_buffers(), which iterates through the buffers\nattached to dirty data folios/pages, accesses the attached buffers without\nlocking the folios/pages.\n\nFor data cache, nilfs_clear_folio_dirty() may be called asynchronously\nwhen the file system degenerates to read only, so\nnilfs_lookup_dirty_data_buffers() still has the potential to cause use\nafter free issues when buffers lose the protection of their dirty state\nmidway due to this asynchronous clearing and are unintentionally freed by\ntry_to_free_buffers().\n\nEliminate this race issue by adjusting the lock section in this function."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"e1fc4a90a90ea8514246c45435662531975937d9","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"72cf688d0ce7e642b12ddc9b2a42524737ec1b4a","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"d8ff250e085a4c4cdda4ad1cdd234ed110393143","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"58c27fa7a610b6e8d44e6220e7dbddfbaccaf439","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"8e1b9201c9a24638cf09c6e1c9f224157328010b","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"4b08d23d7d1917bef4fbee8ad81372f49b006656","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"c437dfac9f7a5a46ac2a5e6d6acd3059e9f68188","versionType":"git"},{"version":"8c26c4e2694a163d525976e804d81cd955bbb40c","status":"affected","lessThan":"367a9bffabe08c04f6d725032cce3d891b2b9e1a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/segment.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.10","versionType":"semver"},{"version":"5.4.291","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.235","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.179","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.129","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.76","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.13","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.2","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/nilfs2/segment.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/e1fc4a90a90ea8514246c45435662531975937d9"},{"url":"https://git.kernel.org/stable/c/72cf688d0ce7e642b12ddc9b2a42524737ec1b4a"},{"url":"https://git.kernel.org/stable/c/d8ff250e085a4c4cdda4ad1cdd234ed110393143"},{"url":"https://git.kernel.org/stable/c/58c27fa7a610b6e8d44e6220e7dbddfbaccaf439"},{"url":"https://git.kernel.org/stable/c/8e1b9201c9a24638cf09c6e1c9f224157328010b"},{"url":"https://git.kernel.org/stable/c/4b08d23d7d1917bef4fbee8ad81372f49b006656"},{"url":"https://git.kernel.org/stable/c/c437dfac9f7a5a46ac2a5e6d6acd3059e9f68188"},{"url":"https://git.kernel.org/stable/c/367a9bffabe08c04f6d725032cce3d891b2b9e1a"}],"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 - nilfs2 is a block-device filesystem; the race is driven through local file I/O (write/fsync creating dirty data folios) plus local page-cache pressure on a mounted volume. No network reachability exists, so this is a local attack vector.\nAC:L - The attacker controls both sides of the race — a crafted nilfs2 image deterministically forces the errors=remount-ro fallback that triggers the asynchronous nilfs_clear_folio_dirty(), while write/fsync drives the unlocked buffer walk and posix_fadvise(DONTNEED)/memory pressure drives try_to_free_buffers(). The race window can be retried indefinitely.\nPR:L - An unprivileged local user with write access to a nilfs2 mount that has degraded to read-only can drive both the dirty-buffer collection path and the buffer-freeing path with no capabilities; on desktop/kiosk systems udisks2 auto-mount also lets an unprivileged user get a crafted image mounted.\nUI:N - On an already-mounted nilfs2 volume no victim action is needed — the attacker's own writes, fsync, and cache-eviction calls trigger the race against the always-running segment constructor thread.\nS:U - The use-after-free corrupts kernel slab memory within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The freed buffer_head is read (b_state, b_this_page, b_data, b_page) and queued for actual segment write-out, so contents of a reallocated slab object can be leaked into the on-disk log and read back; a UAF of this shape yields an arbitrary-read primitive.\nI:H - The loop performs get_bh() (atomic_inc) and list_add_tail(&bh->b_assoc_buffers, listp) into the freed bh_cachep object, writing attacker-influenceable pointers into whatever object now occupies that slot — a controllable write primitive suitable for heap grooming and control-flow hijack.\nA:H - Walking and linking freed buffer_heads reliably produces list corruption, slab corruption, and kernel oops/panic, taking the system down."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:54:38.930Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"5.4.291"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"5.10.235"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"5.15.179"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"6.1.129"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"6.6.76"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"6.12.13"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"6.13.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.10","versionEndExcluding":"6.14"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2025-21811","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-03-04T18:01:20.629324Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-03-04T18:07:17.439Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T20:59:47.268Z"}}]}}}