btrfs: lock the inode in shared mode before starting fiemap
CVE-2023-52737
Summary
A vulnerability in the Linux kernel's btrfs file system has been identified that can result in deadlock situations. This occurs because the fiemap operation fails to acquire the inode's lock. Instead, it only locks a file range in the inode's IO tree, potentially leading to blocking scenarios when concurrent fsync operations are executed. The conflict arises from the inode's i_mmap_lock semaphore, which is utilized by both fsync and the btrfs_page_mkwrite() function. If a fault occurs while accessing user space buffers during fiemap, it can lead to prolonged blocking of tasks, affecting overall system functionality and potentially leading to data loss or corruption.
Affected Version(s)
Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 < 519b7e13b5ae8dd38da1e52275705343be6bb508
Linux 6.1.13 <= 6.1.*
References
CVSS V3.1
Timeline
Vulnerability published
Vulnerability Reserved