Files
linux/drivers/block
Tetsuo Handa 310ca162d7 block/loop: Use global lock for ioctl() operation.
syzbot is reporting NULL pointer dereference [1] which is caused by
race condition between ioctl(loop_fd, LOOP_CLR_FD, 0) versus
ioctl(other_loop_fd, LOOP_SET_FD, loop_fd) due to traversing other
loop devices at loop_validate_file() without holding corresponding
lo->lo_ctl_mutex locks.

Since ioctl() request on loop devices is not frequent operation, we don't
need fine grained locking. Let's use global lock in order to allow safe
traversal at loop_validate_file().

Note that syzbot is also reporting circular locking dependency between
bdev->bd_mutex and lo->lo_ctl_mutex [2] which is caused by calling
blkdev_reread_part() with lock held. This patch does not address it.

[1] https://syzkaller.appspot.com/bug?id=f3cfe26e785d85f9ee259f385515291d21bd80a3
[2] https://syzkaller.appspot.com/bug?id=bf154052f0eea4bc7712499e4569505907d15889

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+bf89c128e05dd6c62523@syzkaller.appspotmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-11-08 06:30:11 -07:00
..
2018-10-14 12:47:52 -06:00
2018-10-15 20:08:15 -06:00
2018-10-16 09:49:52 -06:00
2018-10-16 09:50:09 -06:00
2018-10-16 09:50:14 -06:00
2018-10-17 09:42:30 -06:00
2018-10-17 09:42:30 -06:00
2018-10-02 08:36:58 -06:00
2018-10-15 20:07:56 -06:00
2017-02-20 12:16:15 +01:00
2018-10-25 11:17:39 -06:00
2017-08-18 08:45:29 -06:00
2018-11-07 21:17:57 -07:00
2018-10-16 09:49:36 -06:00
2009-03-26 21:15:27 +01:00
2018-10-16 09:49:18 -06:00
2018-10-18 15:14:45 -06:00
2018-10-18 15:14:47 -06:00
2018-11-07 13:44:59 -07:00
2018-10-15 20:08:24 -06:00