• Omar Sandoval's avatar
    loop: fix LOOP_GET_STATUS lock imbalance · bdac616d
    Omar Sandoval authored
    Commit 2d1d4c1e 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: 2d1d4c1e ("loop: don't call into filesystem while holding lo_ctl_mutex")
    Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    bdac616d
loop.c 52.2 KB