CVE-2025-21752 Information
Description
In the Linux kernel the following vulnerability has been resolved:
btrfs: don’t use btrfs_set_item_key_safe on RAID stripe-extents
Don’t use btrfs_set_item_key_safe() to modify the keys in the RAID stripe-tree as this can lead to corruption of the tree which is caught by the checks in btrfs_set_item_key_safe():
BTRFS info (device nvme1n1): leaf 49168384 gen 15 total ptrs 194 free space 8329 owner 12
BTRFS info (device nvme1n1): refs 2 lock_owner 1030 current 1030
[ snip ]
item 105 key (354549760 230 20480) itemoff 14587 itemsize 16
stride 0 devid 5 physical 67502080
item 106 key (354631680 230 4096) itemoff 14571 itemsize 16
stride 0 devid 1 physical 88559616
item 107 key (354631680 230 32768) itemoff 14555 itemsize 16
stride 0 devid 1 physical 88555520
item 108 key (354717696 230 28672) itemoff 14539 itemsize 16
stride 0 devid 2 physical 67604480
[ snip ]
BTRFS critical (device nvme1n1): slot 106 key (354631680 230 32768) new key (354635776 230 4096)
————[ cut here ]————
kernel BUG at fs/btrfs/ctree.c:2602!
Oops: invalid opcode: 0000 [1] PREEMPT SMP PTI
CPU: 1 UID: 0 PID: 1055 Comm: fsstress Not tainted 6.13.0-rc1+ 1464
Hardware name: QEMU Standard PC (i440FX + PIIX 1996) BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
RIP: 0010:btrfs_set_item_key_safe+0xf7/0x270
Code:
While the root cause of the tree order corruption isn’t clear using btrfs_duplicate_item() to copy the item and then adjusting both the key and the per-device physical addresses is a safe way to counter this problem.
Reference
https://git.kernel.org/stable/c/1c25eff52ee5a02a2c4be659a44ae972d9989742 https://git.kernel.org/stable/c/dc14ba10781bd2629835696b7cc1febf914768e9
Share on: