CVE-2026-98083 PUBLISHED

btrfs: fix transaction use-after-free in raid stripe insertion

Assigner: Linux
Reserved: 25.09.2026 Published: 25.09.2026 Updated: 25.09.2026

In the Linux kernel, the following vulnerability has been resolved:

btrfs: fix transaction use-after-free in raid stripe insertion

If allocation of a RAID stripe extent fails, btrfs_insert_one_raid_extent() aborts and ends the transaction before returning -ENOMEM.

btrfs_finish_one_ordered(), the production caller through btrfs_insert_raid_extent(), still owns the transaction handle. It handles the error by aborting the transaction and then reaches the common exit path, which ends the transaction again.

The premature end can free the handle and drop its transaction reference. Transaction cleanup can then free the transaction before the caller's second abort accesses the handle and transaction, resulting in use-after-free.

Keep the abort at the failure site, but let the caller's common exit path end the transaction once, after it has finished using both objects.

Metrics

CVSS Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 7

AV:L - The bug is reached through local file writes: buffered or direct writes on a mounted btrfs raid-stripe-tree filesystem create ordered extents, and btrfs_finish_one_ordered() then calls btrfs_insert_raid_extent() -> btrfs_insert_one_raid_extent(). No remote peer supplies input that causes the failure. AC:H - The bug fires only when a small, non-memcg-accounted kzalloc(GFP_NOFS) of the stripe extent fails, which needs system-wide memory exhaustion the attacker cannot reliably produce. It also needs a non-default CONFIG_BTRFS_EXPERIMENTAL kernel and an admin-created RAID_STRIPE_TREE filesystem. PR:L - Once such a filesystem is mounted, any unprivileged user with write access to a file on it can drive ordered extent completion into btrfs_insert_one_raid_extent(). No capability check exists on this path. UI:N - The attacker only issues their own write operations to a filesystem that is already mounted; no mounting of attacker media or other victim action is needed. S:U - The corrupted objects are kernel btrfs_trans_handle and btrfs_transaction structures in the same kernel security authority; no VM, IOMMU or sandbox boundary is crossed. C:H - After the premature btrfs_end_transaction() frees the trans handle and drops the transaction reference, btrfs_finish_one_ordered() aborts on the freed handle and transaction. That use-after-free of slab objects could be reclaimed by attacker-sprayed data to leak kernel memory. I:H - The caller's btrfs_abort_transaction() writes to the freed handle and transaction, and its second btrfs_end_transaction() frees the handle again. This use-after-write and double free of slab objects is a memory-corruption primitive usable for control-flow hijack. A:H - The double end/free of the btrfs transaction handle and use of the freed transaction reliably corrupts slab state or oopses the kernel, taking down the system and the filesystem.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 02c372e1f016e5113217597ab37b399c4e407477 to b185bdf30313e213fa1c887fe22fc3d513c061d9 (excl.)
  • affected from 02c372e1f016e5113217597ab37b399c4e407477 to 2fbfd02bdfe12b20bd3cc7a3190fb32e3f7072f5 (excl.)
  • affected from 02c372e1f016e5113217597ab37b399c4e407477 to b7b94923b3b5774d85a2a7c8d6eb9e3e0ef66685 (excl.)
  • affected from 02c372e1f016e5113217597ab37b399c4e407477 to a8813a923f9e43f788b357fb55c35f7f6ed6f98c (excl.)
  • Version ab69bf6f8970c09d3735c25094e9471d54365282 is affected
  • affected from 6.6.130 to 6.7 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 6.7 is affected
  • unaffected from 0 to 6.7 (excl.)
  • unaffected from 6.12.111 to 6.12.* (incl.)
  • unaffected from 6.18.53 to 6.18.* (incl.)
  • unaffected from 7.2.7 to 7.2.* (incl.)
  • unaffected from 7.3-rc2 to * (incl.)

References