]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix multishot poll on overflow
authorDylan Yudaken <dylany@fb.com>
Thu, 30 Jun 2022 09:12:27 +0000 (02:12 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jul 2022 00:39:17 +0000 (18:39 -0600)
commitb60280cd8180b346f79de9193953b71add9a1386
tree82f56a9dcd4cbe0d3c777e73e95d57035107fc02
parent4f44b63153289c381a6eadd16b83f6277025e247
io_uring: fix multishot poll on overflow

On overflow, multishot poll can still complete with the IORING_CQE_F_MORE
flag set.
If in the meantime the user clears a CQE and a the poll was cancelled then
the poll will post a CQE without the IORING_CQE_F_MORE (and likely result
-ECANCELED).

However when processing the application will encounter the non-overflow
CQE which indicates that there will be no more events posted. Typical
userspace applications would free memory associated with the poll in this
case.
It will then subsequently receive the earlier CQE which has overflowed,
which breaks the contract given by the IORING_CQE_F_MORE flag.

Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220630091231.1456789-9-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/poll.c