Skip to content

Commit b2e74db

Browse files
isilenceaxboe
authored andcommitted
io_uring/net: don't overflow multishot recv
Don't allow overflowing multishot recv CQEs, it might get out of hand, hurt performance, and in the worst case scenario OOM the task. Cc: stable@vger.kernel.org Fixes: b3fdea6 ("io_uring: multishot recv") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/0b295634e8f1b71aa764c984608c22d85f88f75c.1691757663.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 1bfed23 commit b2e74db

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

io_uring/net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret,
642642

643643
if (!mshot_finished) {
644644
if (io_aux_cqe(req, issue_flags & IO_URING_F_COMPLETE_DEFER,
645-
*ret, cflags | IORING_CQE_F_MORE, true)) {
645+
*ret, cflags | IORING_CQE_F_MORE, false)) {
646646
io_recv_prep_retry(req);
647647
/* Known not-empty or unknown state, retry */
648648
if (cflags & IORING_CQE_F_SOCK_NONEMPTY ||

0 commit comments

Comments
 (0)