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 kernel-libbpf-develUpgrade kernel-debuginfo-common-x86_64Upgrade bpftool6.12Upgrade kernel-livepatch-6.1.144-170.251Upgrade kernelUpgrade perf6.12Upgrade kernel6.12-tools-debuginfoUpgrade kernel6.12-libbpf-develUpgrade python3-perf6.12-debuginfoUpgrade kernel-libbpf-debuginfoUpgrade kernel-libbpf-staticUpgrade kernel-modules-extra-commonUpgrade kernel-toolsUpgrade kernel6.12-libbpf-staticUpgrade kernel6.12-libbpfUpgrade kernel-debuginfoUpgrade bpftool-debuginfoUpgrade kernel6.12-toolsUpgrade kernel6.12-tools-develUpgrade kernel6.12-debuginfo-common-x86_64Upgrade kernel-develUpgrade bpftoolUpgrade perf-debuginfoUpgrade kernel6.12-develUpgrade kernel-tools-debuginfoUpgrade python3-perf-debuginfoUpgrade bpftool6.12-debuginfoUpgrade kernel-livepatch-6.12.37-61.105Upgrade kernel-tools-develUpgrade python3-perf6.12Upgrade kernel6.12-modules-extra-commonUpgrade kernel6.12-headersUpgrade kernel-debuginfo-common-aarch64Upgrade python3-perfUpgrade perfUpgrade kernel6.12-modules-extraUpgrade kernel6.12-debuginfo-common-aarch64Upgrade kernel-headersUpgrade kernel-modules-extraUpgrade kernel-libbpfUpgrade perf6.12-debuginfoUpgrade kernel6.12Upgrade kernel6.12-debuginfoUpgrade kernel6.12-libbpf-debuginfo | Sep 9, 2025 | Jul 25, 2025 |
| Debian | — | Upgrade linux-6.1Upgrade linux | Jul 28, 2025 | Jul 28, 2025 |
| Suse | — | Upgrade kernel-devel-azureUpgrade kernel-azureUpgrade kernel-rt-extraUpgrade gfs2-kmp-azureUpgrade kernel-azure-extraUpgrade kernel-docs-htmlUpgrade kernel-rt_debugUpgrade dlm-kmp-azureUpgrade dtb-marvellUpgrade dtb-amlogicUpgrade dtb-sprdUpgrade reiserfs-kmp-rtUpgrade reiserfs-kmp-azureUpgrade kselftests-kmp-defaultUpgrade kernel-symsUpgrade kernel-kvmsmallUpgrade dtb-apmUpgrade kernel-azure-vdsoUpgrade dtb-socionextUpgrade kernel-debug-develUpgrade kernel-64kb-develUpgrade dtb-amdUpgrade cluster-md-kmp-64kbUpgrade kernel-rt-develUpgrade kernel-obs-qaUpgrade kernel-macrosUpgrade kernel-docsUpgrade kernel-rt-livepatch-develUpgrade cluster-md-kmp-defaultUpgrade dtb-renesasUpgrade dtb-armUpgrade dlm-kmp-rtUpgrade kernel-syms-rtUpgrade kernel-devel-rtUpgrade kernel-default-extraUpgrade kernel-default-baseUpgrade dtb-mediatekUpgrade kselftests-kmp-rtUpgrade dlm-kmp-defaultUpgrade kernel-rt_debug-vdsoUpgrade kernel-64kb-extraUpgrade dtb-nvidiaUpgrade dtb-appleUpgrade reiserfs-kmp-defaultUpgrade ocfs2-kmp-rtUpgrade kernel-default-livepatch-develUpgrade kernel-defaultUpgrade dtb-rockchipUpgrade dtb-exynosUpgrade kernel-default-optionalUpgrade kernel-64kb-optionalUpgrade kselftests-kmp-azureUpgrade kernel-zfcpdumpUpgrade gfs2-kmp-defaultUpgrade kernel-rt_debug-develUpgrade kernel-develUpgrade gfs2-kmp-rtUpgrade kernel-default-vdsoUpgrade kernel-rt-optionalUpgrade dlm-kmp-64kbUpgrade dtb-caviumUpgrade ocfs2-kmp-defaultUpgrade dtb-hisiliconUpgrade dtb-xilinxUpgrade kernel-64kbUpgrade ocfs2-kmp-64kbUpgrade gfs2-kmp-64kbUpgrade kernel-default-livepatchUpgrade kernel-kvmsmall-develUpgrade cluster-md-kmp-rtUpgrade kernel-obs-buildUpgrade dtb-allwinnerUpgrade kernel-debug-vdsoUpgrade kernel-rt-vdsoUpgrade kernel-azure-optionalUpgrade kernel-azure-develUpgrade kernel-kvmsmall-vdsoUpgrade dtb-freescaleUpgrade kernel-source-rtUpgrade dtb-broadcomUpgrade dtb-qcomUpgrade ocfs2-kmp-azureUpgrade cluster-md-kmp-azureUpgrade kernel-rt-livepatchUpgrade kernel-sourceUpgrade kernel-source-azureUpgrade kselftests-kmp-64kbUpgrade kernel-rtUpgrade kernel-debugUpgrade dtb-lgUpgrade reiserfs-kmp-64kbUpgrade dtb-amazonUpgrade kernel-syms-azureUpgrade kernel-default-develUpgrade kernel-default-base-rebuildUpgrade dtb-alteraUpgrade kernel-source-vanilla | Dec 5, 2025 | Aug 18, 2025 |
| Ubuntu | — | Upgrade linux-image-ibm-lts-24.04Upgrade linux-image-6.8.0-100-lowlatency-64kUpgrade linux-image-awsUpgrade linux-image-lowlatency-64k-6.8Upgrade linux-image-gcp-64k-6.14Upgrade linux-image-generic-hwe-24.04Upgrade linux-image-azure-6.8Upgrade linux-image-6.14.0-1014-azureUpgrade linux-image-virtual-6.8Upgrade linux-image-6.8.0-100-fipsUpgrade linux-image-nvidia-64kUpgrade linux-image-gcp-fips-6.8Upgrade linux-image-xilinx-6.8Upgrade linux-image-6.8.0-1046-aws-fipsUpgrade linux-image-realtime-hwe-22.04Upgrade linux-image-realtimeUpgrade linux-image-azure-fips-6.8Upgrade linux-image-gcp-fipsUpgrade linux-image-generic-hwe-22.04Upgrade linux-image-raspiUpgrade linux-image-6.8.0-1047-raspiUpgrade linux-image-6.8.0-1046-azure-fipsUpgrade linux-image-gcp-64k-6.8Upgrade linux-image-oem-22.04dUpgrade linux-image-generic-64k-hwe-22.04Upgrade linux-image-virtual-hwe-22.04Upgrade linux-image-lowlatency-64k-hwe-22.04Upgrade linux-image-gcpUpgrade linux-image-realtime-hwe-24.04Upgrade linux-image-generic-6.14Upgrade linux-image-generic-6.8Upgrade linux-image-ibm-6.8Upgrade linux-image-aws-fips-6.8Upgrade linux-image-virtual-6.14Upgrade linux-image-6.8.1-1041-realtimeUpgrade linux-image-raspi-realtimeUpgrade linux-image-xilinxUpgrade linux-image-6.8.0-1043-oracleUpgrade linux-image-aws-64k-6.8Upgrade linux-image-aws-64k-lts-24.04Upgrade linux-image-generic-64k-6.8Upgrade linux-image-6.8.0-1046-nvidiaUpgrade linux-image-azureUpgrade linux-image-virtual-hwe-24.04Upgrade linux-image-nvidia-hwe-22.04Upgrade linux-image-gcp-lts-24.04Upgrade linux-image-intel-iot-realtimeUpgrade linux-image-oem-22.04cUpgrade linux-image-gcp-64kUpgrade linux-image-oem-24.04cUpgrade linux-image-oem-24.04aUpgrade linux-image-oracle-64k-6.14Upgrade linux-image-oracle-6.8Upgrade linux-image-6.14.0-1015-aws-64kUpgrade linux-image-6.14.0-1014-realtimeUpgrade linux-image-azure-nvidia-6.14Upgrade linux-image-realtime-6.8.1Upgrade linux-image-aws-6.14Upgrade linux-image-aws-6.8Upgrade linux-image-6.14.0-1015-awsUpgrade linux-image-fips-6.8Upgrade linux-image-6.8.0-1043-oracle-64kUpgrade linux-image-6.14.0-34-genericUpgrade linux-image-oem-22.04bUpgrade linux-image-aws-64kUpgrade linux-image-azure-fipsUpgrade linux-image-generic-64k-6.14Upgrade linux-image-intel-iotgUpgrade linux-image-6.14.0-1007-azure-nvidiaUpgrade linux-image-6.14.0-1014-oemUpgrade linux-image-gcp-6.14Upgrade linux-image-6.8.0-1043-gkeUpgrade linux-image-aws-64k-6.14Upgrade linux-image-6.14.0-1018-gcpUpgrade linux-image-6.8.0-1046-awsUpgrade linux-image-kvmUpgrade linux-image-6.14.0-1016-raspiUpgrade linux-image-gke-64k-6.8Upgrade linux-image-oracle-64kUpgrade linux-image-6.8.0-1047-gcp-fipsUpgrade linux-image-nvidia-lowlatency-64k-6.8Upgrade linux-image-aws-lts-24.04Upgrade linux-image-gke-6.8Upgrade linux-image-raspi-6.8Upgrade linux-image-raspi-6.14Upgrade linux-image-realtime-6.14Upgrade linux-image-6.8.0-1046-aws-64kUpgrade linux-image-lowlatency-6.8Upgrade linux-image-oracle-6.14Upgrade linux-image-gkeop-6.8Upgrade linux-image-gcp-64k-lts-24.04Upgrade linux-image-oracle-64k-lts-24.04Upgrade linux-image-6.8.0-2037-raspi-realtimeUpgrade linux-image-gkeUpgrade linux-image-xilinx-zynqmpUpgrade linux-image-6.8.0-1051-azureUpgrade linux-image-6.8.0-1046-nvidia-64kUpgrade linux-image-gcp-6.8Upgrade linux-image-gkeopUpgrade linux-image-azure-6.14Upgrade linux-image-6.8.0-1047-gcp-64kUpgrade linux-image-ibm-classicUpgrade linux-image-genericUpgrade linux-image-nvidia-lowlatencyUpgrade linux-image-6.8.0-1030-gkeopUpgrade linux-image-oracle-lts-24.04Upgrade linux-image-nvidia-lowlatency-64kUpgrade linux-image-nvidia-lowlatency-6.8Upgrade linux-image-6.8.0-1046-azureUpgrade linux-image-nvidia-64k-6.8Upgrade linux-image-lowlatency-64kUpgrade linux-image-6.14.0-1018-gcp-64kUpgrade linux-image-lowlatency-hwe-22.04Upgrade linux-image-6.8.0-1046-nvidia-lowlatency-64kUpgrade linux-image-6.8.0-100-genericUpgrade linux-image-6.14.0-34-generic-64kUpgrade linux-image-nvidia-6.8Upgrade linux-image-nvidiaUpgrade linux-image-oem-24.04Upgrade linux-image-generic-64kUpgrade linux-image-6.8.0-1043-gke-64kUpgrade linux-image-virtualUpgrade linux-image-oracleUpgrade linux-image-lowlatencyUpgrade linux-image-6.14.0-1015-oracleUpgrade linux-image-azure-lts-24.04Upgrade linux-image-6.8.0-100-lowlatencyUpgrade linux-image-6.8.0-1023-xilinxUpgrade linux-image-generic-lpaeUpgrade linux-image-oem-24.04bUpgrade linux-image-ibmUpgrade linux-image-6.8.0-1046-nvidia-lowlatencyUpgrade linux-image-fipsUpgrade linux-image-aws-fipsUpgrade linux-image-6.8.0-1044-ibmUpgrade linux-image-oracle-64k-6.8Upgrade linux-image-oem-22.04aUpgrade linux-image-oem-22.04Upgrade linux-image-gke-64kUpgrade linux-image-nvidia-64k-hwe-22.04Upgrade linux-image-raspi-realtime-6.8Upgrade linux-image-oem-6.14Upgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-6.8.0-100-generic-64kUpgrade linux-image-6.14.0-1015-oracle-64kUpgrade linux-image-6.8.0-1047-gcpUpgrade linux-image-azure-nvidia | 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