Skip to contentSkip to conversation

io_uring/net: correctly handle multishot recvmsg retry setup

PATCH New Jens Axboe 1 participant 1 message Mar 8, 2024 io_uring

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 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.

Fixes 9bb66906f23e ("io_uring: support multishot in recvmsg")

---

io_uring/net.c +2 -1
index e50947e7cd57..52f0d3b735fd 100644
@@ -931,7 +931,8 @@ int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags)
 			kfree(kmsg->free_iov);
 		io_netmsg_recycle(req, issue_flags);
 		req->flags &= ~REQ_F_NEED_CLEANUP;
-	}
+	} else if (ret == -EAGAIN)
+		return io_setup_async_msg(req, kmsg, issue_flags);
 
 	return ret;
 }
Signature · 1 line
Jens Axboe