netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] packet: allow MSG_NOSIGNAL in recvmsg
@ 2023-02-24  7:17 David Lamparter
  2023-02-24 10:26 ` Eric Dumazet
  0 siblings, 1 reply; 10+ messages in thread
From: David Lamparter @ 2023-02-24  7:17 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Eric Dumazet, David Lamparter, Willem de Bruijn

packet_recvmsg() whitelists a bunch of MSG_* flags, which notably does
not include MSG_NOSIGNAL.  Unfortunately, io_uring always sets
MSG_NOSIGNAL, meaning AF_PACKET sockets can't be used in io_uring
recvmsg().

As AF_PACKET sockets never generate SIGPIPE to begin with, MSG_NOSIGNAL
is a no-op and can simply be ignored.

Signed-off-by: David Lamparter <equinox@diac24.net>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
---
 net/packet/af_packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index d4e76e2ae153..67c0a57e6dd8 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3410,7 +3410,7 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 	unsigned int origlen = 0;
 
 	err = -EINVAL;
-	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT|MSG_ERRQUEUE))
+	if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT|MSG_ERRQUEUE|MSG_NOSIGNAL))
 		goto out;
 
 #if 0
-- 
2.39.2


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

end of thread, other threads:[~2023-02-24 16:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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       ` [PATCH] io_uring: remove MSG_NOSIGNAL from recvmsg David Lamparter
2023-02-24 15:42         ` David Lamparter
2023-02-24 16:14         ` Eric Dumazet
2023-02-24 16:57         ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).