btrfs: fix missing last_unlink_trans update when removing a directory
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 12fcfd22fe5bf4fe74710232098bc101af497995 · < fb388eb58c1ba047ccabc33901839acfecadcf49| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix missing last_unlink_trans update when removing a directory
When removing a directory we are not updating its last_unlink_trans field, which can result in incorrect fsync behaviour in case some one fsyncs the directory after it was removed because it's holding a file descriptor on it.
Example scenario:
mkdir /mnt/dir1 mkdir /mnt/dir1/dir2 mkdir /mnt/dir3
sync -f /mnt
# Do some change to the directory and fsync it. chmod 700 /mnt/dir1 xfs_io -c fsync /mnt/dir1
# Move dir2 out of dir1 so that dir1 becomes empty. mv /mnt/dir1/dir2 /mnt/dir3/
From the CVE record · Linux
The Linux kernel’s btrfs code fails to update a directory field when removing the directory, which can cause incorrect fsync behavior. If a removed directory is fsynced through an open file descriptor and a power failure follows, log replay can fail with an EIO error when the filesystem is mounted. Triggering this sequence requires local filesystem operations; the input does not specify authentication requirements.
Engineers running Linux systems with btrfs filesystems should check their kernel; affected versions were not provided.