[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230224071745.20717-1-equinox@diac24.net>
Date: Fri, 24 Feb 2023 08:17:46 +0100
From: David Lamparter <equinox@...c24.net>
To: netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
David Lamparter <equinox@...c24.net>,
Willem de Bruijn <willemdebruijn.kernel@...il.com>
Subject: [PATCH net-next] packet: allow MSG_NOSIGNAL in recvmsg
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@...c24.net>
Cc: Willem de Bruijn <willemdebruijn.kernel@...il.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
Powered by blists - more mailing lists