Re: [PATCH] mount: Fix race in loop device reuse code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022/01/20 20:47, Jan Kara wrote:
> Fix the problem by rechecking that loop device is still attached after
> opening the device. This makes sure the kernel will not autoclear the
> device anymore.

Since this block is marked as /* overlap -- full size and offset match (reuse) */ ,
can just checking that neither loopcxt_get_fd() nor loopcxt_get_info() failed guarantee
that full size and offset still match? Isn't there possibility that autoclear of file1
completes and another thread again assigns file2 (with different size or offset) right
before /* Open loop device to block device autoclear... */ line? Don't we need to
compare with more robust identifier like device:inode pair?




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux