io_uring: grab task reference for poll requests
authorJens Axboe <axboe@kernel.dk>
Fri, 3 Apr 2020 17:19:06 +0000 (11:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 3 Apr 2020 17:35:57 +0000 (11:35 -0600)
commit3537b6a7c65434d0d2cc0c9862e69be11c367fdc
tree8f3c4d985747b9c52e4eaef92254958da32b75a8
parenta6ba632d2c249a4390289727c07b8b55eb02a41d
io_uring: grab task reference for poll requests

We can have a task exit if it's not the owner of the ring. Be safe and
grab an actual reference to it, to avoid a potential use-after-free.

Reported-by: Dan Melnic <dmm@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c