diff mbox series

[for-6.9] io_uring/net: restore msg_control on sendzc retry

Message ID cc1d5d9df0576fa66ddad4420d240a98a020b267.1712596179.git.asml.silence@gmail.com (mailing list archive)
State New
Headers show
Series [for-6.9] io_uring/net: restore msg_control on sendzc retry | expand

Commit Message

Pavel Begunkov April 8, 2024, 5:11 p.m. UTC
cac9e4418f4cb ("io_uring/net: save msghdr->msg_control for retries")
reinstatiates msg_control before every __sys_sendmsg_sock(), since the
function can overwrite the value in msghdr. We need to do same for
zerocopy sendmsg.

Cc: stable@vger.kernel.org
Link: https://github.com/axboe/liburing/issues/1067
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 io_uring/net.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jens Axboe April 9, 2024, 3:48 a.m. UTC | #1
On 4/8/24 11:11 AM, Pavel Begunkov wrote:
> cac9e4418f4cb ("io_uring/net: save msghdr->msg_control for retries")
> reinstatiates msg_control before every __sys_sendmsg_sock(), since the
> function can overwrite the value in msghdr. We need to do same for
> zerocopy sendmsg.

I added:

Fixes: 493108d95f146 ("io_uring/net: zerocopy sendmsg")
Jens Axboe April 9, 2024, 9 p.m. UTC | #2
On Mon, 08 Apr 2024 18:11:09 +0100, Pavel Begunkov wrote:
> cac9e4418f4cb ("io_uring/net: save msghdr->msg_control for retries")
> reinstatiates msg_control before every __sys_sendmsg_sock(), since the
> function can overwrite the value in msghdr. We need to do same for
> zerocopy sendmsg.
> 
> 

Applied, thanks!

[1/1] io_uring/net: restore msg_control on sendzc retry
      commit: 4fe82aedeb8a8cb09bfa60f55ab57b5c10a74ac4

Best regards,
diff mbox series

Patch

diff --git a/io_uring/net.c b/io_uring/net.c
index 1e7665ff6ef7..4afb475d4197 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -1276,6 +1276,7 @@  int io_sendmsg_zc(struct io_kiocb *req, unsigned int issue_flags)
 
 	if (req_has_async_data(req)) {
 		kmsg = req->async_data;
+		kmsg->msg.msg_control_user = sr->msg_control;
 	} else {
 		ret = io_sendmsg_copy_hdr(req, &iomsg);
 		if (ret)