linux-stable/drivers/block
Jan Kara 0da03cab87 loop: Fix deadlock when calling blkdev_reread_part()
Calling blkdev_reread_part() under loop_ctl_mutex causes lockdep to
complain about circular lock dependency between bdev->bd_mutex and
lo->lo_ctl_mutex. The problem is that on loop device open or close
lo_open() and lo_release() get called with bdev->bd_mutex held and they
need to acquire loop_ctl_mutex. OTOH when loop_reread_partitions() is
called with loop_ctl_mutex held, it will call blkdev_reread_part() which
acquires bdev->bd_mutex. See syzbot report for details [1].

Move call to blkdev_reread_part() in __loop_clr_fd() from under
loop_ctl_mutex to finish fixing of the lockdep warning and the possible
deadlock.

[1] https://syzkaller.appspot.com/bug?id=bf154052f0eea4bc7712499e4569505907d1588

Reported-by: syzbot <syzbot+4684a000d5abdade83fac55b1e7d1f935ef1936e@syzkaller.appspotmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-11-08 06:30:32 -07:00
..
aoe aoe: convert aoeblk to blk-mq 2018-10-14 12:47:52 -06:00
drbd Merge branch 'work.afs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-11-01 19:58:52 -07:00
mtip32xx mtip32xx: clean an indentation issue, remove extraneous tabs 2018-10-30 14:31:36 -06:00
paride paride: convert pf to blk-mq 2018-10-15 20:08:15 -06:00
rsxx pci-v4.20-changes 2018-10-25 06:50:48 -07:00
xen-blkback xen/blkback: remove unused pers_gnts_lock from struct xen_blkif_ring 2018-08-27 12:12:04 -04:00
zram drivers/block: remove redundant 'default n' from Kconfig-s 2018-10-10 14:11:08 -06:00
amiflop.c amiflop: convert to blk-mq 2018-10-16 09:49:52 -06:00
ataflop.c ataflop: convert to blk-mq 2018-10-16 09:50:09 -06:00
brd.c block: brd: associate with queue until adding disk 2018-11-01 19:59:51 -06:00
cryptoloop.c block: cryptoloop: Remove VLA usage of skcipher 2018-09-28 12:46:07 +08:00
floppy.c floppy: convert to blk-mq 2018-10-16 09:50:14 -06:00
Kconfig drivers/block: Remove DAC960 driver 2018-10-17 09:42:30 -06:00
loop.c loop: Fix deadlock when calling blkdev_reread_part() 2018-11-08 06:30:32 -07:00
loop.h block/loop: Use global lock for ioctl() operation. 2018-11-08 06:30:11 -07:00
Makefile drivers/block: Remove DAC960 driver 2018-10-17 09:42:30 -06:00
nbd.c iov_iter: Separate type from direction and use accessor functions 2018-10-24 00:41:07 +01:00
null_blk.h null_blk: Add conventional zone configuration for zoned support 2018-11-07 13:41:50 -07:00
null_blk_main.c null_blk: Add conventional zone configuration for zoned support 2018-11-07 13:41:50 -07:00
null_blk_zoned.c null_blk: Add conventional zone configuration for zoned support 2018-11-07 13:41:50 -07:00
pktcdvd.c pktcdvd: fix fall-through annotation 2018-10-02 08:36:58 -06:00
ps3disk.c ps3disk: convert to blk-mq 2018-10-15 20:07:56 -06:00
ps3vram.c block: genhd: add 'groups' argument to device_add_disk 2018-09-28 08:30:28 -06:00
rbd.c libceph, rbd, ceph: move ceph_osdc_alloc_messages() calls 2018-10-22 10:28:22 +02:00
rbd_types.h rbd: RBD_V{1,2}_DATA_FORMAT macros 2017-02-20 12:16:15 +01:00
skd_main.c skd: fix unchecked return values 2018-10-25 11:17:39 -06:00
skd_s1120.h skd: Use __packed only when needed 2017-08-18 08:45:29 -06:00
sunvdc.c sunvdc: fix compiler warning 2018-11-07 21:17:57 -07:00
swim.c swim: convert to blk-mq 2018-10-16 09:49:18 -06:00
swim3.c swim3: convert to blk-mq 2018-10-16 09:49:36 -06:00
swim_asm.S
sx8.c sx8: switch to the generic DMA API 2018-10-18 15:14:45 -06:00
umem.c umem: switch to the generic DMA API 2018-10-18 15:14:47 -06:00
umem.h
virtio_blk.c blk-mq: abstract out queue map 2018-11-07 13:44:59 -07:00
xen-blkfront.c xen/blkfront: avoid NULL blkfront_info dereference on device removal 2018-10-25 11:17:39 -06:00
xsysace.c xsysace: convert to blk-mq 2018-10-15 20:08:24 -06:00
z2ram.c powerpc updates for 4.20 2018-10-26 14:36:21 -07:00