]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring/poll: correctly handle io_poll_add() return value on update
authorJens Axboe <axboe@kernel.dk>
Mon, 1 Dec 2025 20:25:22 +0000 (13:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:06 +0000 (12:57 +0100)
commit13a8f7b88c2d40c6b33f6216190478dda95d385f
tree5ddc2844947e0109afbef409fc91f2ae1eb8f606
parent3dfe2e1531c837f18c541e1db90f6ef7890a497c
io_uring/poll: correctly handle io_poll_add() return value on update

commit 84230ad2d2afbf0c44c32967e525c0ad92e26b4e upstream.

When the core of io_uring was updated to handle completions
consistently and with fixed return codes, the POLL_REMOVE opcode
with updates got slightly broken. If a POLL_ADD is pending and
then POLL_REMOVE is used to update the events of that request, if that
update causes the POLL_ADD to now trigger, then that completion is lost
and a CQE is never posted.

Additionally, ensure that if an update does cause an existing POLL_ADD
to complete, that the completion value isn't always overwritten with
-ECANCELED. For that case, whatever io_poll_add() set the value to
should just be retained.

Cc: stable@vger.kernel.org
Fixes: 97b388d70b53 ("io_uring: handle completions in the core")
Reported-by: syzbot+641eec6b7af1f62f2b99@syzkaller.appspotmail.com
Tested-by: syzbot+641eec6b7af1f62f2b99@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/poll.c