]> git.ipfire.org Git - people/ms/linux.git/commitdiff
io_uring: fix io_recvmsg_prep_multishot sparse warnings
authorDylan Yudaken <dylany@fb.com>
Fri, 5 Aug 2022 11:54:50 +0000 (04:54 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 5 Aug 2022 14:41:18 +0000 (08:41 -0600)
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: 9bb66906f23e ("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>
io_uring/net.c

index f9f080b3cc1ee2c14f1dca048496e7416345b80d..e6fc9748fbd241ddde4257019833209aa1e46441 100644 (file)
@@ -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;
 }