From: David Lamparter Date: Fri, 24 Feb 2023 15:01:24 +0000 (+0100) Subject: io_uring: remove MSG_NOSIGNAL from recvmsg X-Git-Tag: v6.6.7~3350^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7605c43d67face310b4b87dee1a28bc0c8cd8c0f;p=platform%2Fkernel%2Flinux-starfive.git io_uring: remove MSG_NOSIGNAL from recvmsg 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(). Cc: stable@vger.kernel.org # v5.10+ Signed-off-by: David Lamparter Cc: Eric Dumazet Cc: Jens Axboe Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20230224150123.128346-1-equinox@diac24.net Signed-off-by: Jens Axboe --- diff --git a/io_uring/net.c b/io_uring/net.c index cbd4b72..b7f190ca 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)