io_uring: ensure task_work gets run as part of cancelations
authorJens Axboe <axboe@kernel.dk>
Thu, 9 Dec 2021 15:54:29 +0000 (08:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Dec 2021 09:57:15 +0000 (10:57 +0100)
commit8e12976c0c19ebc14b60046b1348c516a74c25a2
tree5667ab64ca5b984b7b8e2a24f42a4e243396164d
parenteb313c47b2762565d48627d49ce661ae5018d155
io_uring: ensure task_work gets run as part of cancelations

commit 78a780602075d8b00c98070fa26e389b3b3efa72 upstream.

If we successfully cancel a work item but that work item needs to be
processed through task_work, then we can be sleeping uninterruptibly
in io_uring_cancel_generic() and never process it. Hence we don't
make forward progress and we end up with an uninterruptible sleep
warning.

While in there, correct a comment that should be IFF, not IIF.

Reported-and-tested-by: syzbot+21e6887c0be14181206d@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c