{"id":"CVE-2025-21699","state":"PUBLISHED","title":"gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ngfs2: Truncate address space when flipping GFS2_DIF_JDATA flag\n\nTruncate an inode's address space when flipping the GFS2_DIF_JDATA flag:\ndepending on that flag, the pages in the address space will either use\nbuffer heads or iomap_folio_state structs, and we cannot mix the two.","publishedAt":"2025-02-12T13:52:50.962Z","updatedAt":"2026-08-05T11:53:41.986Z","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":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"8c41abc11aa8438c9ed2d973f97e66674c0355df","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"4e3ded34f3f3c9d7ed2aac7be8cf51153646574a","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"2a40a140e11fec699e128170ccaa98b6b82cb503","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"4dd57d1f0e9844311c635a7fb39abce4f2ac5a61","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"4516febe325342555bb09ca5b396fb816d655821","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"5bb1fd0855bb0abc7d97e44758d6ffed7882d2d0","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"7c9d9223802fbed4dee1ae301661bf346964c9d2","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/gfs2/file.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.10","versionType":"semver"},{"version":"5.10.234","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.178","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.128","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.75","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.12","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.1","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/gfs2/file.c"]}],"references":["https://git.kernel.org/stable/c/8c41abc11aa8438c9ed2d973f97e66674c0355df","https://git.kernel.org/stable/c/4e3ded34f3f3c9d7ed2aac7be8cf51153646574a","https://git.kernel.org/stable/c/2a40a140e11fec699e128170ccaa98b6b82cb503","https://git.kernel.org/stable/c/4dd57d1f0e9844311c635a7fb39abce4f2ac5a61","https://git.kernel.org/stable/c/4516febe325342555bb09ca5b396fb816d655821","https://git.kernel.org/stable/c/5bb1fd0855bb0abc7d97e44758d6ffed7882d2d0","https://git.kernel.org/stable/c/7c9d9223802fbed4dee1ae301661bf346964c9d2","https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html","https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:08:39.238Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21699.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21699","state":"PUBLISHED","datePublished":"2025-02-12T13:52:50.962Z","dateUpdated":"2026-08-05T11:53:41.986Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.748Z"},"containers":{"cna":{"title":"gfs2: Truncate address space when flipping GFS2_DIF_JDATA flag","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ngfs2: Truncate address space when flipping GFS2_DIF_JDATA flag\n\nTruncate an inode's address space when flipping the GFS2_DIF_JDATA flag:\ndepending on that flag, the pages in the address space will either use\nbuffer heads or iomap_folio_state structs, and we cannot mix the two."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"8c41abc11aa8438c9ed2d973f97e66674c0355df","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"4e3ded34f3f3c9d7ed2aac7be8cf51153646574a","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"2a40a140e11fec699e128170ccaa98b6b82cb503","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"4dd57d1f0e9844311c635a7fb39abce4f2ac5a61","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"4516febe325342555bb09ca5b396fb816d655821","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"5bb1fd0855bb0abc7d97e44758d6ffed7882d2d0","versionType":"git"},{"version":"2164f9b9186962ffb7c687e18ec6f5255525f09d","status":"affected","lessThan":"7c9d9223802fbed4dee1ae301661bf346964c9d2","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/gfs2/file.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.10","versionType":"semver"},{"version":"5.10.234","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.178","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.128","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.75","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.12","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.1","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/gfs2/file.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/8c41abc11aa8438c9ed2d973f97e66674c0355df"},{"url":"https://git.kernel.org/stable/c/4e3ded34f3f3c9d7ed2aac7be8cf51153646574a"},{"url":"https://git.kernel.org/stable/c/2a40a140e11fec699e128170ccaa98b6b82cb503"},{"url":"https://git.kernel.org/stable/c/4dd57d1f0e9844311c635a7fb39abce4f2ac5a61"},{"url":"https://git.kernel.org/stable/c/4516febe325342555bb09ca5b396fb816d655821"},{"url":"https://git.kernel.org/stable/c/5bb1fd0855bb0abc7d97e44758d6ffed7882d2d0"},{"url":"https://git.kernel.org/stable/c/7c9d9223802fbed4dee1ae301661bf346964c9d2"}],"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 the local ioctl(FS_IOC_SETFLAGS) syscall path (ioctl_setflags → vfs_fileattr_set → gfs2_fileattr_set → do_gfs2_set_flags) on a file residing on a mounted GFS2 filesystem. No network-facing code path processes attacker data here.\nAC:L - Exploitation is fully deterministic and single-threaded: populate the page cache by writing to a file, flip GFS2_DIF_JDATA with chattr, then touch/truncate/fadvise the file to drive the mismatched aops over the stale folio->private. There is no race to win and no memory-layout precondition outside the attacker's control.\nPR:L - The only access control on the path is inode_owner_or_capable(), so any unprivileged local user who owns a file on the GFS2 mount can flip the flag; fileattr_set_prepare() restricts only APPEND/IMMUTABLE and project IDs, not FS_JOURNAL_DATA_FL. GFS2 is deployed as admin-mounted shared cluster/HPC storage where ordinary users routinely own files.\nUI:N - The attacker performs every step themselves (create file, write, chattr, re-access) with no action by any other user. The GFS2 filesystem is already mounted as part of normal operation in the target deployment.\nS:U - The corruption is confined to kernel memory within the same security authority; there is no VM, IOMMU, or sandbox boundary crossed. This is a standard local kernel privilege-escalation scope.\nC:H - The type confusion yields out-of-bounds reads past the ~24-byte iomap_folio_state (b_size/b_data/b_end_io read from adjacent slab objects) and leaks buffer_head pointer contents through ifs->state bitmap reads, plus a use-after-free on buffer_head that gives the attacker control of freed-object contents and thus an arbitrary-read primitive.\nI:H - ifs_free() calls kfree() on a live buffer_head still linked into the bh ring, bh_lru and b_assoc_buffers lists, producing a UAF with list-unlink write primitives; bitmap_set()/atomic_add() write directly into b_folio/b_blocknr/b_this_page, and in the opposite direction an OOB-read b_data is used as a memcpy destination for user-controlled data while b_end_io is called as a function pointer.\nA:H - spin_lock_irqsave() on ifs->state_lock aliased onto a non-zero bh->b_state spins forever with interrupts disabled, causing a hard lockup, and the corrupted b_this_page/b_folio pointers plus the buffer_head UAF reliably produce oopses and panics."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:53:41.986Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"5.10.234"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"5.15.178"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"6.1.128"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"6.6.75"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"6.12.12"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"6.13.1"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.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":5.5,"attackVector":"LOCAL","baseSeverity":"MEDIUM","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","integrityImpact":"NONE","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"NONE"}},{"other":{"type":"ssvc","content":{"id":"CVE-2025-21699","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2025-10-01T19:51:04.949443Z"}}}],"problemTypes":[{"descriptions":[{"lang":"en","type":"CWE","description":"CWE-noinfo Not enough information"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-10-01T19:57:09.197Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T20:59:23.304Z"}}]}}}