Re: [PATCH -next v2] block: fix wrong mode for blkdev_get_by_dev() from disk_scan_partitions()

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

 



On Sun, Jun 18, 2023 at 10:04:02PM +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@xxxxxxxxxx>
> 
> After commit 2736e8eeb0cc ("block: use the holder as indication for
> exclusive opens"), blkdev_get_by_dev() will warn if holder is NULL and
> mode contains 'FMODE_EXCL'.
> 
> holder from blkdev_get_by_dev() from disk_scan_partitions() is always NULL,
> hence it should not use 'FMODE_EXCL', which is broben by the commit. For
> consequence, WARN_ON_ONCE() will be triggered from blkdev_get_by_dev()
> if user scan partitions with device opened exclusively.
> 
> Fix this problem by removing 'FMODE_EXCL' from disk_scan_partitions(),
> as it used to be.
> 
> Reported-by: syzbot+00cd27751f78817f167b@xxxxxxxxxxxxxxxxxxxxxxxxx
> Link: https://syzkaller.appspot.com/bug?extid=00cd27751f78817f167b
> Fixes: 2736e8eeb0cc ("block: use the holder as indication for exclusive opens")
> Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>
> ---

Looks good to me,
Reviewed-by: Christian Brauner <brauner@xxxxxxxxxx>



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux