From patchwork Wed Jun 7 14:05:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13270807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF404C7EE25 for ; Wed, 7 Jun 2023 14:43:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F52D8E0005; Wed, 7 Jun 2023 10:43:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A51D8E0001; Wed, 7 Jun 2023 10:43:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 794C88E0005; Wed, 7 Jun 2023 10:43:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 64EED8E0001 for ; Wed, 7 Jun 2023 10:43:56 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E1783AEBC1 for ; Wed, 7 Jun 2023 14:43:55 +0000 (UTC) X-FDA: 80876221230.26.7690677 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf29.hostedemail.com (Postfix) with ESMTP id CDC41120027 for ; Wed, 7 Jun 2023 14:43:53 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cYa92MoQ; spf=pass (imf29.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686149034; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oJUkpOQ7e9hBKCJRUR3yZoWIoUWj9MtOId6LGPzA6h0=; b=PjcBJ7IIvVppvocwsW08gMJ291QIO8ZvgtdLmKMcAMi3hYV9tExjhSczsGHWK4mJaKufRe 2ku5zxD+R3F7lmTSzvOJgaTA5S+G95mZWIIGWQoEjZt4CpO26tVB8qlgJ707R2Z/tHO9Sh tWd0sSK1pDyPYJwOa3qbxsN8I3mbz7o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686149034; a=rsa-sha256; cv=none; b=zpOlQRECSANCGFmPdS+wcSttPXNBXUZnzwMbB6X+gM9uHB4MHJEaxq3gY6pSthBi/tyxA7 08CbSGjVjO74VWSbXy5DBeUvXNGd8OXViOrBQp30OTezFWW73QQ3w/5yg178E9Gk68y1IZ EUx2EL7GrLpZA7OYyNJsyT240A37Vbc= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cYa92MoQ; spf=pass (imf29.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686149032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oJUkpOQ7e9hBKCJRUR3yZoWIoUWj9MtOId6LGPzA6h0=; b=cYa92MoQ8h4gMYAqT1/7KhoW4QxyMnREu3fdX+5s9bWjLI3IlY7B1OZSNzT8/LtrvAwoIg fi+CJvs/RrrvqeZmM7JqDx9V7VKwITTdOseklWAyslpRsYaoJqsWGN5R4luO4HsWhX0TNK cF5W9s+XdHvqxyEn/YsVJ/CHTIrOry0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-529-okqwxf2jM56vi69Z88OO0A-1; Wed, 07 Jun 2023 10:06:14 -0400 X-MC-Unique: okqwxf2jM56vi69Z88OO0A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DCD9080027F; Wed, 7 Jun 2023 14:06:13 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id EBE75140E955; Wed, 7 Jun 2023 14:06:10 +0000 (UTC) From: David Howells To: netdev@vger.kernel.org, Linus Torvalds Cc: David Howells , Chuck Lever , Boris Pismenny , John Fastabend , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v5 02/14] tls: Allow MSG_SPLICE_PAGES but treat it as normal sendmsg Date: Wed, 7 Jun 2023 15:05:47 +0100 Message-ID: <20230607140559.2263470-3-dhowells@redhat.com> In-Reply-To: <20230607140559.2263470-1-dhowells@redhat.com> References: <20230607140559.2263470-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Stat-Signature: 33xn4g85o1w87yxcgstnpqfqqhyy1k34 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: CDC41120027 X-Rspam-User: X-HE-Tag: 1686149033-11239 X-HE-Meta: U2FsdGVkX1/YnOhga2R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4kA8npW61xlv6c1hEW+ANpGLNjP+PdtR7ah5DVCVzYPvMN4mlxFJCI90C2uQlCan/UgtGYofj9bE1Sb/CGcRWreGv8e9uZsil9c5sFD93qklSUG3ULBqVPPnF0Dv+63G1B1vBfLadqCah0DoPaCSgKxsXRfCIQvsF/Z94QlTSvF39JX8P+/0sV5UyuAQU8rHg2lX37T7eCOoedQOYZgWlNC97dzlXLq+hZYZoISmHrJ/PWk5FRlmyGjezIC2F5HYUBqcovIxtLCWea1Tv0YsNoiMIdyp+Rm62sij1P6dvK2ZwR8lEgw0VW8ozxPZ9wV4v06Mm5NYkw0osVPW2rUYHF/zAp8DnpO0EsgOWLd88MeYimjAb9V+ZGf5cMiPBXNxyX6DMydvj0tB4MidwXO9ZhCX8rgZi2ptDrAadad1/EhNIb+qwF/i6dYLgUtW42yhIzbY1f82oA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Allow MSG_SPLICE_PAGES to be specified to sendmsg() but treat it as normal sendmsg for now. This means the data will just be copied until MSG_SPLICE_PAGES is handled. Signed-off-by: David Howells cc: Chuck Lever cc: Boris Pismenny cc: John Fastabend cc: Jakub Kicinski cc: Eric Dumazet cc: "David S. Miller" cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: netdev@vger.kernel.org --- net/tls/tls_device.c | 3 ++- net/tls/tls_sw.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index a959572a816f..9ef766e41c7a 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -447,7 +447,8 @@ static int tls_push_data(struct sock *sk, long timeo; if (flags & - ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SENDPAGE_NOTLAST)) + ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SENDPAGE_NOTLAST | + MSG_SPLICE_PAGES)) return -EOPNOTSUPP; if (unlikely(sk->sk_err)) diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 1a53c8f481e9..38acc27a0dd0 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -955,7 +955,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) int pending; if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | - MSG_CMSG_COMPAT)) + MSG_CMSG_COMPAT | MSG_SPLICE_PAGES)) return -EOPNOTSUPP; ret = mutex_lock_interruptible(&tls_ctx->tx_lock);