io_uring: don't attempt to re-flush completions
authorJens Axboe <axboe@kernel.dk>
Sun, 28 Feb 2021 16:59:26 +0000 (09:59 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 1 Mar 2021 17:10:31 +0000 (10:10 -0700)
commit784ea643ff113a5618017379ad46ac4acd1d9b5d
tree6672ab7db5bc313870acd99a6f3d8fe58edb4dc9
parent027754bcbdb7e5e55b41df1172624677da529e66
io_uring: don't attempt to re-flush completions

If 'node' is NULL, there are no more completions to flush after doing
this round. And since the req flushing will put ctx references, it's
quite possible that the ctx is gone after the flush. Don't dereference
it unless we know we have more to flush.

Fixes: 65453d1efbd2 ("io_uring: enable req cache for task_work items")
Reported-by: syzbot+a157ac7c03a56397f553@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c