All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Lamparter <equinox@diac24.net>
To: io-uring@vger.kernel.org
Cc: netdev@vger.kernel.org, David Lamparter <equinox@diac24.net>,
	Eric Dumazet <edumazet@google.com>, Jens Axboe <axboe@kernel.dk>
Subject: [PATCH] io_uring: remove MSG_NOSIGNAL from recvmsg
Date: Fri, 24 Feb 2023 16:01:24 +0100	[thread overview]
Message-ID: <20230224150123.128346-1-equinox@diac24.net> (raw)
In-Reply-To: <CANn89iJE6SpB2bfXEc=73km6B2xtBSWHj==WsYFnH089WPKtSA@mail.gmail.com>

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...

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)
-- 
2.39.2


  reply	other threads:[~2023-02-24 15:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24  7:17 [PATCH net-next] packet: allow MSG_NOSIGNAL in recvmsg David Lamparter
2023-02-24 10:26 ` Eric Dumazet
2023-02-24 12:01   ` David Lamparter
2023-02-24 13:01     ` Eric Dumazet
2023-02-24 14:32   ` Jens Axboe
2023-02-24 14:54     ` Eric Dumazet
2023-02-24 15:01       ` David Lamparter [this message]
2023-02-24 15:42         ` [PATCH] io_uring: remove MSG_NOSIGNAL from recvmsg David Lamparter
2023-02-24 16:14         ` Eric Dumazet
2023-02-24 16:57         ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230224150123.128346-1-equinox@diac24.net \
    --to=equinox@diac24.net \
    --cc=axboe@kernel.dk \
    --cc=edumazet@google.com \
    --cc=io-uring@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.