Skip to content

Commit

Permalink
io_uring/net: use the correct msghdr union member in io_sendmsg_copy_hdr
Browse files Browse the repository at this point in the history
[ Upstream commit 26fed83 ]

Rather than assign the user pointer to msghdr->msg_control, assign it
to msghdr->msg_control_user to make sparse happy. They are in a union
so the end result is the same, but let's avoid new sparse warnings and
squash this one.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306210654.mDMcyMuB-lkp@intel.com/
Fixes: cac9e44 ("io_uring/net: save msghdr->msg_control for retries")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Jens Axboe authored and Greg Kroah-Hartman committed Jun 28, 2023
1 parent 1b7b048 commit eff07bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions io_uring/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static int io_sendmsg_copy_hdr(struct io_kiocb *req,
ret = sendmsg_copy_msghdr(&iomsg->msg, sr->umsg, sr->msg_flags,
&iomsg->free_iov);
/* save msg_control as sys_sendmsg() overwrites it */
sr->msg_control = iomsg->msg.msg_control;
sr->msg_control = iomsg->msg.msg_control_user;
return ret;
}

Expand Down Expand Up @@ -289,7 +289,7 @@ int io_sendmsg(struct io_kiocb *req, unsigned int issue_flags)

if (req_has_async_data(req)) {
kmsg = req->async_data;
kmsg->msg.msg_control = sr->msg_control;
kmsg->msg.msg_control_user = sr->msg_control;
} else {
ret = io_sendmsg_copy_hdr(req, &iomsg);
if (ret)
Expand Down

0 comments on commit eff07bf

Please sign in to comment.