]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fail io_uring_register(2) on a dying io_uring instance
authorJens Axboe <axboe@kernel.dk>
Mon, 22 Apr 2019 16:23:23 +0000 (10:23 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 22 Apr 2019 16:37:07 +0000 (10:37 -0600)
commitcf91b4fcd428cf413c12fd73e075dc213363dd21
treef40aab4ff93b1443117ce1ed87a63c6ebd0dda2b
parent1235a6abd75c8d03bfe89d705a905fafada5e45f
io_uring: fail io_uring_register(2) on a dying io_uring instance

If we have multiple threads doing io_uring_register(2) on an io_uring
fd, then we can potentially try and kill the percpu reference while
someone else has already killed it.

Prevent this race by failing io_uring_register(2) if the ref is marked
dying. This is safe since we're inside the io_uring mutex.

Fixes: 9fee7732a686 ("io_uring: fix possible deadlock between io_uring_{enter,register}")
Reported-by: syzbot <syzbot+10d25e23199614b7721f@syzkaller.appspotmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c