Skip to content

Commit deaef31

Browse files
committed
io_uring/net: correctly handle multishot recvmsg retry setup
If we loop for multishot receive on the initial attempt, and then abort later on to wait for more, we miss a case where we should be copying the io_async_msghdr from the stack to stable storage. This leads to the next retry potentially failing, if the application had the msghdr on the stack. Cc: stable@vger.kernel.org Fixes: 9bb6690 ("io_uring: support multishot in recvmsg") Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b5311db commit deaef31

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

io_uring/net.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,8 @@ int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)
931931
kfree(kmsg->free_iov);
932932
io_netmsg_recycle(req, issue_flags);
933933
req->flags &= ~REQ_F_NEED_CLEANUP;
934-
}
934+
} else if (ret == -EAGAIN)
935+
return io_setup_async_msg(req, kmsg, issue_flags);
935936

936937
return ret;
937938
}

0 commit comments

Comments
 (0)