• Jens Axboe's avatar
    io_uring: pin SQPOLL data before unlocking ring lock · 41d3a6bd
    Jens Axboe authored
    We need to re-check sqd->thread after we've dropped the lock. Pin
    the sqd before doing the lockdep lock dance, and check if the thread
    is alive after that. It's either NULL or alive, as the SQPOLL thread
    cannot exit without holding the same sqd->lock.
    
    Reported-and-tested-by: syzbot+337de45f13a4fd54d708@syzkaller.appspotmail.com
    Fixes: fa84693b ("io_uring: ensure IORING_REGISTER_IOWQ_MAX_WORKERS works with SQPOLL")
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    41d3a6bd
io_uring.c 267 KB