From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DDF1BA3E for ; Tue, 7 Mar 2023 17:46:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCF5DC433EF; Tue, 7 Mar 2023 17:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678211216; bh=zkeuX0BT4oQflnCR/p/JWi3iPcKScckVZ5EU8niHtv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ucJqigfOGewn7nM4kjU7SGvPLM05a/H5Uq4K+QIWeSBZglODMDzamM6RxUSzJp+fw czOAP3DRTpOhWKAC3iJFqFWodz2LC70YsnssgkG5bh8hPdsWtm3RGkLxNR8gUGxb+L bJC54Su5p3uBra8RKZr/i53Gv5SYpkVo5wWAIuN0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Lamparter , Eric Dumazet , Jens Axboe Subject: [PATCH 6.2 0760/1001] io_uring: remove MSG_NOSIGNAL from recvmsg Date: Tue, 7 Mar 2023 17:58:52 +0100 Message-Id: <20230307170054.726333255@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170022.094103862@linuxfoundation.org> References: <20230307170022.094103862@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: David Lamparter commit 7605c43d67face310b4b87dee1a28bc0c8cd8c0f upstream. 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 Signed-off-by: Greg Kroah-Hartman --- io_uring/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/io_uring/net.c +++ b/io_uring/net.c @@ -568,7 +568,7 @@ int io_recvmsg_prep(struct io_kiocb *req 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)