]> git.baikalelectronics.ru Git - kernel.git/commit
loop: fix LOOP_GET_STATUS lock imbalance
authorOmar Sandoval <osandov@fb.com>
Fri, 6 Apr 2018 16:57:03 +0000 (09:57 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 Apr 2018 14:38:46 +0000 (08:38 -0600)
commita2e3505f64b924db3522b4f61a0faefbd2b62d17
treed883f14fdc2dc308c13aae0cf80042deec2ffd6b
parent238919aeef3fd2d03ac86dc069afb00dc122058a
loop: fix LOOP_GET_STATUS lock imbalance

Commit 5556ba8d244e made loop_get_status() drop lo_ctx_mutex before
returning, but the loop_get_status_old(), loop_get_status64(), and
loop_get_status_compat() wrappers don't call loop_get_status() if the
passed argument is NULL. The callers expect that the lock is dropped, so
make sure we drop it in that case, too.

Reported-by: syzbot+31e8daa8b3fc129e75f2@syzkaller.appspotmail.com
Fixes: 5556ba8d244e ("loop: don't call into filesystem while holding lo_ctl_mutex")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c