Skip to content

Commit dd821e0

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix missing msg_name assignment
Ensure to set msg.msg_name for the async portion of send/recvmsg, as the header copy will copy to/from it. Cc: [email protected] # v5.5+ Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 309fc03 commit dd821e0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/io_uring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3553,6 +3553,7 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
35533553
if (req->flags & REQ_F_NEED_CLEANUP)
35543554
return 0;
35553555

3556+
io->msg.msg.msg_name = &io->msg.addr;
35563557
io->msg.iov = io->msg.fast_iov;
35573558
ret = sendmsg_copy_msghdr(&io->msg.msg, sr->msg, sr->msg_flags,
35583559
&io->msg.iov);
@@ -3734,6 +3735,7 @@ static int __io_compat_recvmsg_copy_hdr(struct io_kiocb *req,
37343735

37353736
static int io_recvmsg_copy_hdr(struct io_kiocb *req, struct io_async_ctx *io)
37363737
{
3738+
io->msg.msg.msg_name = &io->msg.addr;
37373739
io->msg.iov = io->msg.fast_iov;
37383740

37393741
#ifdef CONFIG_COMPAT

0 commit comments

Comments
 (0)