public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: fix io_recvmsg_prep_multishot casts
@ 2022-08-05 11:54 Dylan Yudaken
  2022-08-05 14:41 ` Jens Axboe
  2022-08-05 14:41 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Dylan Yudaken @ 2022-08-05 11:54 UTC (permalink / raw)
  To: Jens Axboe, Pavel Begunkov, io-uring
  Cc: Kernel-team, Dylan Yudaken, kernel test robot

Fix casts missing the __user parts. This seemed to only cause errors on
the alpha build, but it was definitely an oversight.

Reported-by: kernel test robot <[email protected]>
Fixes: 9bb66906f23e ("io_uring: support multishot in recvmsg")
Signed-off-by: Dylan Yudaken <[email protected]>
---

Hi,

I tried to reproduce this issue to be sure this fixes it, but I could not get the
warnings out of the gcc I have locally.
That being said it seems like a fairly clear fix.

 io_uring/net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/io_uring/net.c b/io_uring/net.c
index 32fc3da04e41..fa7a28b6bad5 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -575,12 +575,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;
 }

base-commit: b2a88c212e652e94f1e4b635910972ac57ba4e97
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] io_uring: fix io_recvmsg_prep_multishot casts
  2022-08-05 11:54 [PATCH] io_uring: fix io_recvmsg_prep_multishot casts Dylan Yudaken
@ 2022-08-05 14:41 ` Jens Axboe
  2022-08-05 14:41 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2022-08-05 14:41 UTC (permalink / raw)
  To: Dylan Yudaken, Pavel Begunkov, io-uring; +Cc: Kernel-team, kernel test robot

On 8/5/22 5:54 AM, Dylan Yudaken wrote:
> Fix casts missing the __user parts. This seemed to only cause errors on
> the alpha build, but it was definitely an oversight.
> 
> Reported-by: kernel test robot <[email protected]>
> Fixes: 9bb66906f23e ("io_uring: support multishot in recvmsg")
> Signed-off-by: Dylan Yudaken <[email protected]>
> ---
> 
> Hi,
> 
> I tried to reproduce this issue to be sure this fixes it, but I could not get the
> warnings out of the gcc I have locally.
> That being said it seems like a fairly clear fix.

If you do:

axboe@m1 ~/gi/linux-block (io_uring-6.0)> make C=1 io_uring/net.o
o_uring/net.c: note: in included file (through io_uring/io_uring.h):
io_uring/slist.h:138:29: warning: no newline at end of file
io_uring/net.c:579:44: warning: incorrect type in assignment (different address spaces)
io_uring/net.c:579:44:    expected void [noderef] __user *msg_control_user
io_uring/net.c:579:44:    got void *
io_uring/net.c:584:14: warning: incorrect type in assignment (different address spaces)
io_uring/net.c:584:14:    expected void [noderef] __user *
io_uring/net.c:584:14:    got void *

it'll show it, you need 'sparse' installed for that.


-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] io_uring: fix io_recvmsg_prep_multishot casts
  2022-08-05 11:54 [PATCH] io_uring: fix io_recvmsg_prep_multishot casts Dylan Yudaken
  2022-08-05 14:41 ` Jens Axboe
@ 2022-08-05 14:41 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2022-08-05 14:41 UTC (permalink / raw)
  To: io-uring, asml.silence, dylany; +Cc: Kernel-team, lkp

On Fri, 5 Aug 2022 04:54:50 -0700, Dylan Yudaken wrote:
> Fix casts missing the __user parts. This seemed to only cause errors on
> the alpha build, but it was definitely an oversight.
> 
> 

Applied, thanks!

[1/1] io_uring: fix io_recvmsg_prep_multishot casts
      commit: d1f6222c4978817712e0f2825ce9e830763f0695

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-05 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-05 11:54 [PATCH] io_uring: fix io_recvmsg_prep_multishot casts Dylan Yudaken
2022-08-05 14:41 ` Jens Axboe
2022-08-05 14:41 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox