btrfs: fix transaction abort when snapshotting received subvolumes
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ dd5f9615fc5c5e8d3751aab3a17b92768fb1ce70 · < e1b18b959025e6b5dbad668f391f65d34b39595a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix transaction abort when snapshotting received subvolumes
Currently a user can trigger a transaction abort by snapshotting a previously received snapshot a bunch of times until we reach a BTRFS_UUID_KEY_RECEIVED_SUBVOL item overflow (the maximum item size we can store in a leaf). This is very likely not common in practice, but if it happens, it turns the filesystem into RO mode. The snapshot, send and set_received_subvol and subvol_setflags (used by receive) don't require CAP_SYS_ADMIN, just inode_owner_or_capable(). A malicious user could use this to turn a filesystem into RO mode and disrupt a system.
Reproducer script:
$ cat test.sh #!/bin/bash
DEV=/dev/sdi MNT=/mnt/sdi
# Use smallest node size to make the test faster. mkfs.btrfs -f --nodesize 4K $DEV mount $DEV $MNT
# Create a subvolume and set it to RO so that it can be used for send. btrfs subvolume create $MNT/sv touch $MNT/sv/foo btrfs property set $MNT/sv ro true
From the CVE record · Linux
The Linux kernel’s btrfs snapshot handling can abort a transaction when repeated snapshots of a previously received subvolume overflow a UUID item. A local user who owns the relevant inode or has the required capability can trigger this without CAP_SYS_ADMIN, putting the filesystem into read-only mode and disrupting the system.
Engineers running Linux systems with btrfs filesystems should check their kernel versions; affected versions are not specified in the input.