diff mbox series

io_uring: remove MSG_NOSIGNAL from recvmsg

Message ID 20230224150123.128346-1-equinox@diac24.net (mailing list archive)
State Not Applicable
Headers show
Series io_uring: remove MSG_NOSIGNAL from recvmsg | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

David Lamparter Feb. 24, 2023, 3:01 p.m. UTC
MSG_NOSIGNAL is not applicable for the receiving side, SIGPIPE is
generated when trying to write to a "broken pipe".  AF_PACKET's
packet_recvmsg() does enforce this, giving back EINVAL when MSG_NOSIGNAL
is set - making it unuseable in io_uring's recvmsg.

Remove MSG_NOSIGNAL from io_recvmsg_prep().

Signed-off-by: David Lamparter <equinox@diac24.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
---

> Sure, or perhaps David wanted to take care of this.

Here you go.  But maybe give me a few hours to test/confirm...

Comments

David Lamparter Feb. 24, 2023, 3:42 p.m. UTC | #1
On Fri, Feb 24, 2023 at 04:01:24PM +0100, David Lamparter wrote:
> MSG_NOSIGNAL is not applicable for the receiving side, SIGPIPE is
> generated when trying to write to a "broken pipe".  AF_PACKET's
> packet_recvmsg() does enforce this, giving back EINVAL when MSG_NOSIGNAL
> is set - making it unuseable in io_uring's recvmsg.
> ---
> > Sure, or perhaps David wanted to take care of this.
> 
> Here you go.  But maybe give me a few hours to test/confirm...

Unsurprisingly, it works as expected.
Eric Dumazet Feb. 24, 2023, 4:14 p.m. UTC | #2
On Fri, Feb 24, 2023 at 4:04 PM David Lamparter <equinox@diac24.net> wrote:
>
> MSG_NOSIGNAL is not applicable for the receiving side, SIGPIPE is
> generated when trying to write to a "broken pipe".  AF_PACKET's
> packet_recvmsg() does enforce this, giving back EINVAL when MSG_NOSIGNAL
> is set - making it unuseable in io_uring's recvmsg.
>
> Remove MSG_NOSIGNAL from io_recvmsg_prep().
>
> Signed-off-by: David Lamparter <equinox@diac24.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jens Axboe <axboe@kernel.dk>
> ---
>
> > Sure, or perhaps David wanted to take care of this.
>
> Here you go.  But maybe give me a few hours to test/confirm...
>

Reviewed-by: Eric Dumazet <edumazet@google.com>

Thanks !
Jens Axboe Feb. 24, 2023, 4:57 p.m. UTC | #3
On Fri, 24 Feb 2023 16:01:24 +0100, David Lamparter wrote:
> MSG_NOSIGNAL is not applicable for the receiving side, SIGPIPE is
> generated when trying to write to a "broken pipe".  AF_PACKET's
> packet_recvmsg() does enforce this, giving back EINVAL when MSG_NOSIGNAL
> is set - making it unuseable in io_uring's recvmsg.
> 
> Remove MSG_NOSIGNAL from io_recvmsg_prep().
> 
> [...]

Applied, thanks!

[1/1] io_uring: remove MSG_NOSIGNAL from recvmsg
      commit: 4492575406d8592b623987cb36b8234d285cfa17

Best regards,
diff mbox series

Patch

diff --git a/io_uring/net.c b/io_uring/net.c
index cbd4b725f58c..b7f190ca528e 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -567,7 +567,7 @@  int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 	sr->flags = READ_ONCE(sqe->ioprio);
 	if (sr->flags & ~(RECVMSG_FLAGS))
 		return -EINVAL;
-	sr->msg_flags = READ_ONCE(sqe->msg_flags) | MSG_NOSIGNAL;
+	sr->msg_flags = READ_ONCE(sqe->msg_flags);
 	if (sr->msg_flags & MSG_DONTWAIT)
 		req->flags |= REQ_F_NOWAIT;
 	if (sr->msg_flags & MSG_ERRQUEUE)