In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix a race between renames and directory logging
We have a race between a rename and directory inode logging that if it happens and we crash/power fail before the rename completes, the next time the filesystem is mounted, the log replay code will end up deleting the file that was being renamed.
This is best explained following a step by step analysis of an interleaving of steps that lead into this situation.
Consider the initial conditions:
1) We are at transaction N;
2) We have directories A and B created in a past transaction (< N);
3) We have inode X corresponding to a file that has 2 hardlinks, one in directory A and the other in directory B, so we'll name them as "A/foo_link1" and "B/foo_link2". Both hard links were persisted in a past transaction (< N);
4) We have inode Y corresponding to a file that as a single hard link and is located in directory A, we'll name it as "A/bar". This file was also persisted in a past transaction (< N).
The steps leading to a file loss are the following and for all of them we are under transaction N:
1) Link "A/foo_link1" is removed, so inode's X last_unlink_trans field is updated to N, through btrfs_unlink() -> btrfs_record_unlink_dir();
2) Task A starts a rename for inode Y, with the goal of renaming from "A/bar" to "A/baz", so we enter btrfs_rename();
3) Task A inserts the new BTRFS_INODE_REF_KEY for inode Y by calling btrfs_insert_inode_ref();
4) Because the rename happens in the same directory, we don't set the last_unlink_trans field of directoty A's inode to the current transaction id, that is, we don't cal btrfs_record_unlink_dir();
5) Task A then removes the entries from directory A (BTRFS_DIR_ITEM_KEY and BTRFS_DIR_INDEX_KEY items) when calling __btrfs_unlink_inode() (actually the dir index item is added as a delayed item, but the effect is the same);
6) Now before task A adds the new entry "A/baz" to directory A by calling btrfs_add_link(), another task, task B is logging inode X;
7) Task B starts a fsync of inode X and after logging inode X, at btrfs_log_inode_parent() it calls btrfs_log_all_parents(), since inode X has a last_unlink_trans value of N, set at in step 1;
8) At btrfs_log_all_parents() we search for all parent directories of inode X using the commit root, so we find directories A and B and log them. Bu when logging direct A, we don't have a dir index item for inode Y anymore, neither the old name "A/bar" nor for the new name "A/baz" since the rename has deleted the old name but has not yet inserted the new name - task A hasn't called yet btrfs_add_link() to do that.
Note that logging directory A doesn't fallback to a transaction commit because its last_unlink_trans has a lower value than the current transaction's id (see step 4);
9) Task B finishes logging directories A and B and gets back to btrfs_sync_file() where it calls btrfs_sync_log() to persist the log tree;
10) Task B successfully persisted the log tree, btrfs_sync_log() completed with success, and a power failure happened.
We have a log tree without any directory entry for inode Y, so the log replay code deletes the entry for inode Y, name "A/bar", from the subvolume tree since it doesn't exist in the log tree and the log tree is authorative for its index (we logged a BTRFS_DIR_LOG_INDEX_KEY item that covers the index range for the dentry that corresponds to "A/bar").
Since there's no other hard link for inode Y and the log replay code deletes the name "A/bar", the file is lost.
The issue wouldn't happen if task B synced the log only after task A called btrfs_log_new_name(), which would update the log with the new name for inode Y ("A/bar").
Fix this by pinning the log root during renames before removing the old directory entry, and unpinning af ---truncated---
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon_linux_2023 | — | Upgrade bpftoolUpgrade bpftool-debuginfoUpgrade bpftool6.12Upgrade bpftool6.12-debuginfoUpgrade kernelUpgrade kernel-debuginfoUpgrade kernel-debuginfo-common-aarch64Upgrade kernel-debuginfo-common-x86_64Upgrade kernel-develUpgrade kernel-headersUpgrade kernel-libbpfUpgrade kernel-libbpf-debuginfoUpgrade kernel-libbpf-develUpgrade kernel-libbpf-staticUpgrade kernel-livepatch-6.1.144-170.251Upgrade kernel-livepatch-6.12.37-61.105Upgrade kernel-modules-extraUpgrade kernel-modules-extra-commonUpgrade kernel-toolsUpgrade kernel-tools-debuginfoUpgrade kernel-tools-develUpgrade kernel6.12Upgrade kernel6.12-debuginfoUpgrade kernel6.12-debuginfo-common-aarch64Upgrade kernel6.12-debuginfo-common-x86_64Upgrade kernel6.12-develUpgrade kernel6.12-headersUpgrade kernel6.12-libbpfUpgrade kernel6.12-libbpf-debuginfoUpgrade kernel6.12-libbpf-develUpgrade kernel6.12-libbpf-staticUpgrade kernel6.12-modules-extraUpgrade kernel6.12-modules-extra-commonUpgrade kernel6.12-toolsUpgrade kernel6.12-tools-debuginfoUpgrade kernel6.12-tools-develUpgrade perfUpgrade perf-debuginfoUpgrade perf6.12Upgrade perf6.12-debuginfoUpgrade python3-perfUpgrade python3-perf-debuginfoUpgrade python3-perf6.12Upgrade python3-perf6.12-debuginfo | Sep 9, 2025 | Jul 25, 2025 |
| Debian | — | Upgrade linuxUpgrade linux-6.1 | Jul 28, 2025 | Jul 28, 2025 |
| Suse | — | Upgrade cluster-md-kmp-64kbUpgrade cluster-md-kmp-azureUpgrade cluster-md-kmp-defaultUpgrade cluster-md-kmp-rtUpgrade dlm-kmp-64kbUpgrade dlm-kmp-azureUpgrade dlm-kmp-defaultUpgrade dlm-kmp-rtUpgrade dtb-allwinnerUpgrade dtb-alteraUpgrade dtb-amazonUpgrade dtb-amdUpgrade dtb-amlogicUpgrade dtb-apmUpgrade dtb-appleUpgrade dtb-armUpgrade dtb-broadcomUpgrade dtb-caviumUpgrade dtb-exynosUpgrade dtb-freescaleUpgrade dtb-hisiliconUpgrade dtb-lgUpgrade dtb-marvellUpgrade dtb-mediatekUpgrade dtb-nvidiaUpgrade dtb-qcomUpgrade dtb-renesasUpgrade dtb-rockchipUpgrade dtb-socionextUpgrade dtb-sprdUpgrade dtb-xilinxUpgrade gfs2-kmp-64kbUpgrade gfs2-kmp-azureUpgrade gfs2-kmp-defaultUpgrade gfs2-kmp-rtUpgrade kernel-64kbUpgrade kernel-64kb-develUpgrade kernel-64kb-extraUpgrade kernel-64kb-optionalUpgrade kernel-azureUpgrade kernel-azure-develUpgrade kernel-azure-extraUpgrade kernel-azure-optionalUpgrade kernel-azure-vdsoUpgrade kernel-debugUpgrade kernel-debug-develUpgrade kernel-debug-vdsoUpgrade kernel-defaultUpgrade kernel-default-baseUpgrade kernel-default-base-rebuildUpgrade kernel-default-develUpgrade kernel-default-extraUpgrade kernel-default-livepatchUpgrade kernel-default-livepatch-develUpgrade kernel-default-optionalUpgrade kernel-default-vdsoUpgrade kernel-develUpgrade kernel-devel-azureUpgrade kernel-devel-rtUpgrade kernel-docsUpgrade kernel-docs-htmlUpgrade kernel-kvmsmallUpgrade kernel-kvmsmall-develUpgrade kernel-kvmsmall-vdsoUpgrade kernel-macrosUpgrade kernel-obs-buildUpgrade kernel-obs-qaUpgrade kernel-rtUpgrade kernel-rt-develUpgrade kernel-rt-extraUpgrade kernel-rt-livepatchUpgrade kernel-rt-livepatch-develUpgrade kernel-rt-optionalUpgrade kernel-rt-vdsoUpgrade kernel-rt_debugUpgrade kernel-rt_debug-develUpgrade kernel-rt_debug-vdsoUpgrade kernel-sourceUpgrade kernel-source-azureUpgrade kernel-source-rtUpgrade kernel-source-vanillaUpgrade kernel-symsUpgrade kernel-syms-azureUpgrade kernel-syms-rtUpgrade kernel-zfcpdumpUpgrade kselftests-kmp-64kbUpgrade kselftests-kmp-azureUpgrade kselftests-kmp-defaultUpgrade kselftests-kmp-rtUpgrade ocfs2-kmp-64kbUpgrade ocfs2-kmp-azureUpgrade ocfs2-kmp-defaultUpgrade ocfs2-kmp-rtUpgrade reiserfs-kmp-64kbUpgrade reiserfs-kmp-azureUpgrade reiserfs-kmp-defaultUpgrade reiserfs-kmp-rt | Dec 5, 2025 | Aug 18, 2025 |
| Ubuntu | — | Upgrade linux-image-6.14.0-1007-azure-nvidiaUpgrade linux-image-6.14.0-1014-azureUpgrade linux-image-6.14.0-1014-oemUpgrade linux-image-6.14.0-1014-realtimeUpgrade linux-image-6.14.0-1015-awsUpgrade linux-image-6.14.0-1015-aws-64kUpgrade linux-image-6.14.0-1015-oracleUpgrade linux-image-6.14.0-1015-oracle-64kUpgrade linux-image-6.14.0-1016-raspiUpgrade linux-image-6.14.0-1018-gcpUpgrade linux-image-6.14.0-1018-gcp-64kUpgrade linux-image-6.14.0-34-genericUpgrade linux-image-6.14.0-34-generic-64kUpgrade linux-image-6.8.0-100-fipsUpgrade linux-image-6.8.0-100-genericUpgrade linux-image-6.8.0-100-generic-64kUpgrade linux-image-6.8.0-100-lowlatencyUpgrade linux-image-6.8.0-100-lowlatency-64kUpgrade linux-image-6.8.0-1023-xilinxUpgrade linux-image-6.8.0-1030-gkeopUpgrade linux-image-6.8.0-1043-gkeUpgrade linux-image-6.8.0-1043-gke-64kUpgrade linux-image-6.8.0-1043-oracleUpgrade linux-image-6.8.0-1043-oracle-64kUpgrade linux-image-6.8.0-1044-ibmUpgrade linux-image-6.8.0-1046-awsUpgrade linux-image-6.8.0-1046-aws-64kUpgrade linux-image-6.8.0-1046-aws-fipsUpgrade linux-image-6.8.0-1046-azureUpgrade linux-image-6.8.0-1046-azure-fipsUpgrade linux-image-6.8.0-1046-nvidiaUpgrade linux-image-6.8.0-1046-nvidia-64kUpgrade linux-image-6.8.0-1046-nvidia-lowlatencyUpgrade linux-image-6.8.0-1046-nvidia-lowlatency-64kUpgrade linux-image-6.8.0-1047-gcpUpgrade linux-image-6.8.0-1047-gcp-64kUpgrade linux-image-6.8.0-1047-gcp-fipsUpgrade linux-image-6.8.0-1047-raspiUpgrade linux-image-6.8.0-1051-azureUpgrade linux-image-6.8.0-2037-raspi-realtimeUpgrade linux-image-6.8.1-1041-realtimeUpgrade linux-image-awsUpgrade linux-image-aws-6.14Upgrade linux-image-aws-6.8Upgrade linux-image-aws-64kUpgrade linux-image-aws-64k-6.14Upgrade linux-image-aws-64k-6.8Upgrade linux-image-aws-64k-lts-24.04Upgrade linux-image-aws-fipsUpgrade linux-image-aws-fips-6.8Upgrade linux-image-aws-lts-24.04Upgrade linux-image-azureUpgrade linux-image-azure-6.14Upgrade linux-image-azure-6.8Upgrade linux-image-azure-fipsUpgrade linux-image-azure-fips-6.8Upgrade linux-image-azure-lts-24.04Upgrade linux-image-azure-nvidiaUpgrade linux-image-azure-nvidia-6.14Upgrade linux-image-fipsUpgrade linux-image-fips-6.8Upgrade linux-image-gcpUpgrade linux-image-gcp-6.14Upgrade linux-image-gcp-6.8Upgrade linux-image-gcp-64kUpgrade linux-image-gcp-64k-6.14Upgrade linux-image-gcp-64k-6.8Upgrade linux-image-gcp-64k-lts-24.04Upgrade linux-image-gcp-fipsUpgrade linux-image-gcp-fips-6.8Upgrade linux-image-gcp-lts-24.04Upgrade linux-image-genericUpgrade linux-image-generic-6.14Upgrade linux-image-generic-6.8Upgrade linux-image-generic-64kUpgrade linux-image-generic-64k-6.14Upgrade linux-image-generic-64k-6.8Upgrade linux-image-generic-64k-hwe-22.04Upgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-generic-hwe-22.04Upgrade linux-image-generic-hwe-24.04Upgrade linux-image-generic-lpaeUpgrade linux-image-gkeUpgrade linux-image-gke-6.8Upgrade linux-image-gke-64kUpgrade linux-image-gke-64k-6.8Upgrade linux-image-gkeopUpgrade linux-image-gkeop-6.8Upgrade linux-image-ibmUpgrade linux-image-ibm-6.8Upgrade linux-image-ibm-classicUpgrade linux-image-ibm-lts-24.04Upgrade linux-image-intel-iot-realtimeUpgrade linux-image-intel-iotgUpgrade linux-image-kvmUpgrade linux-image-lowlatencyUpgrade linux-image-lowlatency-6.8Upgrade linux-image-lowlatency-64kUpgrade linux-image-lowlatency-64k-6.8Upgrade linux-image-lowlatency-64k-hwe-22.04Upgrade linux-image-lowlatency-hwe-22.04Upgrade linux-image-nvidiaUpgrade linux-image-nvidia-6.8Upgrade linux-image-nvidia-64kUpgrade linux-image-nvidia-64k-6.8Upgrade linux-image-nvidia-64k-hwe-22.04Upgrade linux-image-nvidia-hwe-22.04Upgrade linux-image-nvidia-lowlatencyUpgrade linux-image-nvidia-lowlatency-6.8Upgrade linux-image-nvidia-lowlatency-64kUpgrade linux-image-nvidia-lowlatency-64k-6.8Upgrade linux-image-oem-22.04Upgrade linux-image-oem-22.04aUpgrade linux-image-oem-22.04bUpgrade linux-image-oem-22.04cUpgrade linux-image-oem-22.04dUpgrade linux-image-oem-24.04Upgrade linux-image-oem-24.04aUpgrade linux-image-oem-24.04bUpgrade linux-image-oem-24.04cUpgrade linux-image-oem-6.14Upgrade linux-image-oracleUpgrade linux-image-oracle-6.14Upgrade linux-image-oracle-6.8Upgrade linux-image-oracle-64kUpgrade linux-image-oracle-64k-6.14Upgrade linux-image-oracle-64k-6.8Upgrade linux-image-oracle-64k-lts-24.04Upgrade linux-image-oracle-lts-24.04Upgrade linux-image-raspiUpgrade linux-image-raspi-6.14Upgrade linux-image-raspi-6.8Upgrade linux-image-raspi-realtimeUpgrade linux-image-raspi-realtime-6.8Upgrade linux-image-realtimeUpgrade linux-image-realtime-6.14Upgrade linux-image-realtime-6.8.1Upgrade linux-image-realtime-hwe-22.04Upgrade linux-image-realtime-hwe-24.04Upgrade linux-image-virtualUpgrade linux-image-virtual-6.14Upgrade linux-image-virtual-6.8Upgrade linux-image-virtual-hwe-22.04Upgrade linux-image-virtual-hwe-24.04Upgrade linux-image-xilinxUpgrade linux-image-xilinx-6.8Upgrade linux-image-xilinx-zynqmp | Jul 31, 2025 | Jul 25, 2025 |
| Vmware Photon_os | — | Use 'tdnf update' to upgrade all packages to the latest version. | Oct 10, 2025 | Jul 25, 2025 |
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub