Skip to content

Commit

Permalink
io_uring: fix io_recvmsg_prep_multishot sparse warnings
Browse files Browse the repository at this point in the history
Fix casts missing the __user parts. This seemed to only cause errors on
the alpha build, or if checked with sparse, but it was definitely an
oversight.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 9bb6690 ("io_uring: support multishot in recvmsg")
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220805115450.3921352-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Dylan Yudaken authored and Jens Axboe committed Aug 5, 2022
1 parent 4a933e6 commit d1f6222
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 @@ -576,12 +576,12 @@ static int io_recvmsg_prep_multishot(struct io_async_msghdr *kmsg,
if (kmsg->controllen) {
unsigned long control = ubuf + hdr - kmsg->controllen;

kmsg->msg.msg_control_user = (void *) control;
kmsg->msg.msg_control_user = (void __user *) control;
kmsg->msg.msg_controllen = kmsg->controllen;
}

sr->buf = *buf; /* stash for later copy */
*buf = (void *) (ubuf + hdr);
*buf = (void __user *) (ubuf + hdr);
kmsg->payloadlen = *len = *len - hdr;
return 0;
}
Expand Down

0 comments on commit d1f6222

Please sign in to comment.