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 65EF28821 for ; Fri, 10 Mar 2023 15:03:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB974C433D2; Fri, 10 Mar 2023 15:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678460587; bh=bNtznkHANNGICO6vyTjXG+NWodryo0S9sIbQbrjo9nY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dSwQ/qdX3g9EkJzj/teAndq5xOKMzmbkSeEjQ5yeafjpt/QaKJCI3tiqQd5ZUVin0 mZzrrA9W7zCEsFfP3iZrbBDPescVOTN7qxwE5E2K/Ulzvne1mfapvEyP9pvHynnlbS yJe3P09M4DjKofeG5qU8JIEmVg5gNDIAV+FLptGM= 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 5.10 377/529] io_uring: remove MSG_NOSIGNAL from recvmsg Date: Fri, 10 Mar 2023 14:38:40 +0100 Message-Id: <20230310133822.475053307@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133804.978589368@linuxfoundation.org> References: <20230310133804.978589368@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/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -4995,7 +4995,7 @@ static int io_recvmsg_prep(struct io_kio sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr)); sr->len = READ_ONCE(sqe->len); sr->bgid = READ_ONCE(sqe->buf_group); - 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;