{"id":"CVE-2025-39800","state":"PUBLISHED","title":"btrfs: abort transaction on unexpected eb generation at btrfs_copy_root()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: abort transaction on unexpected eb generation at btrfs_copy_root()\n\nIf we find an unexpected generation for the extent buffer we are cloning\nat btrfs_copy_root(), we just WARN_ON() and don't error out and abort the\ntransaction, meaning we allow to persist metadata with an unexpected\ngeneration. Instead of warning only, abort the transaction and return\n-EUCLEAN.","publishedAt":"2025-09-15T12:36:43.043Z","updatedAt":"2026-08-05T12:05:16.237Z","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":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"4290e34fb87ae556b12c216efd0ae91583446b7a","versionType":"git"},{"version":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"4734255ef39b416864139dcda96a387fe5f33a6a","versionType":"git"},{"version":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"da2124719f386b6e5d4d4b1a2e67c440e4d5892f","versionType":"git"},{"version":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"f4f5bd9251a4cbe55aaa05725c6c3c32ad1f74b3","versionType":"git"},{"version":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"33e8f24b52d2796b8cfb28c19a1a7dd6476323a8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/ctree.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.29","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.29","versionType":"semver"},{"version":"6.1.149","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.103","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.44","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.16.4","status":"unaffected","lessThanOrEqual":"6.16.*","versionType":"semver"},{"version":"6.17","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/ctree.c"]}],"references":["https://git.kernel.org/stable/c/4290e34fb87ae556b12c216efd0ae91583446b7a","https://git.kernel.org/stable/c/4734255ef39b416864139dcda96a387fe5f33a6a","https://git.kernel.org/stable/c/da2124719f386b6e5d4d4b1a2e67c440e4d5892f","https://git.kernel.org/stable/c/f4f5bd9251a4cbe55aaa05725c6c3c32ad1f74b3","https://git.kernel.org/stable/c/33e8f24b52d2796b8cfb28c19a1a7dd6476323a8","https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","https://cert-portal.siemens.com/productcert/html/ssa-032379.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/39xxx/CVE-2025-39800.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-39800","state":"PUBLISHED","datePublished":"2025-09-15T12:36:43.043Z","dateUpdated":"2026-08-05T12:05:16.237Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.133Z"},"containers":{"cna":{"title":"btrfs: abort transaction on unexpected eb generation at btrfs_copy_root()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: abort transaction on unexpected eb generation at btrfs_copy_root()\n\nIf we find an unexpected generation for the extent buffer we are cloning\nat btrfs_copy_root(), we just WARN_ON() and don't error out and abort the\ntransaction, meaning we allow to persist metadata with an unexpected\ngeneration. Instead of warning only, abort the transaction and return\n-EUCLEAN."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"4290e34fb87ae556b12c216efd0ae91583446b7a","versionType":"git"},{"version":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"4734255ef39b416864139dcda96a387fe5f33a6a","versionType":"git"},{"version":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"da2124719f386b6e5d4d4b1a2e67c440e4d5892f","versionType":"git"},{"version":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"f4f5bd9251a4cbe55aaa05725c6c3c32ad1f74b3","versionType":"git"},{"version":"be20aa9dbadc8c06283784ee12bbc0d97dea3418","status":"affected","lessThan":"33e8f24b52d2796b8cfb28c19a1a7dd6476323a8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/ctree.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.29","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.29","versionType":"semver"},{"version":"6.1.149","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.103","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.44","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.16.4","status":"unaffected","lessThanOrEqual":"6.16.*","versionType":"semver"},{"version":"6.17","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/ctree.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/4290e34fb87ae556b12c216efd0ae91583446b7a"},{"url":"https://git.kernel.org/stable/c/4734255ef39b416864139dcda96a387fe5f33a6a"},{"url":"https://git.kernel.org/stable/c/da2124719f386b6e5d4d4b1a2e67c440e4d5892f"},{"url":"https://git.kernel.org/stable/c/f4f5bd9251a4cbe55aaa05725c6c3c32ad1f74b3"},{"url":"https://git.kernel.org/stable/c/33e8f24b52d2796b8cfb28c19a1a7dd6476323a8"}],"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 - btrfs is a local filesystem; the vulnerable code is reached through the `BTRFS_IOC_SNAP_CREATE`/`SNAP_CREATE_V2` ioctl path or through relocation on a locally mounted volume. No remote peer data or network protocol handler reaches `btrfs_copy_root()`.\nAC:L - Once the volume carries a tree block with a future generation — a state the attacker authors directly in a crafted image, or that pre-exists from bit rot or an earlier bug — the trigger is a single deterministic ioctl with no race to win and no memory layout to groom. The attacker controls both the on-disk state and the snapshot request, so nothing is beyond their influence.\nPR:L - `__btrfs_ioctl_snap_create()` gates snapshots only on `inode_owner_or_capable()` against the source subvolume, and plain subvolume creation is explicitly unrestricted, so any unprivileged user with write access to a btrfs mount can create a subvolume and then snapshot it to drive `create_pending_snapshot()` into `btrfs_copy_root()`.\nUI:N - The attacker issues the snapshot ioctl themselves against a filesystem that is already mounted, and the balance/relocation path likewise runs without any victim action. No one has to open a file or mount anything at exploitation time.\nS:U - The mishandled metadata, the corrupted extent tree, and the resulting crashes all stay within the kernel's own security authority on the same host; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - Persisting the clone means the bogus-generation block later makes `btrfs_block_can_be_shared()` return false (`buf_gen > btrfs_root_last_snapshot()`), so COW skips ref accounting for a block the new snapshot references; extents are subsequently freed while still in use and reallocated to other files, letting the attacker read data belonging to other users through their own subvolume.\nI:H - The kernel writes metadata it has already recognised as invalid, and the resulting extent-refcount divergence causes in-use blocks to be handed out to unrelated files — arbitrary, persistent corruption of other users' file contents and of filesystem metadata that survives reboot.\nA:H - The `WARN_ON()` alone is an immediate panic under `panic_on_warn`, and the corrupted metadata that gets committed makes later tree reads fail the parent-transid check, leaving the filesystem unmountable or forcing it read-only — a persistent denial of service the attacker can trigger at will."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:05:16.237Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.1.149"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.6.103"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.12.44"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.16.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.29","versionEndExcluding":"6.17"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T17:43:30.834Z"}},{"affected":[{"vendor":"Siemens","product":"SIMATIC CN 4100","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThan":"V5.0","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-05-12T12:07:08.998Z"},"x_adpType":"supplier"}]}}}