From patchwork Wed Jun 7 18:19:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13271088 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 249F9C7EE23 for ; Wed, 7 Jun 2023 18:19:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B3E5F900003; Wed, 7 Jun 2023 14:19:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AEE546B0075; Wed, 7 Jun 2023 14:19:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DD87900003; Wed, 7 Jun 2023 14:19:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8DAB56B0074 for ; Wed, 7 Jun 2023 14:19:40 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5655D1604E3 for ; Wed, 7 Jun 2023 18:19:40 +0000 (UTC) X-FDA: 80876764920.28.7D975AF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 80EB8180021 for ; Wed, 7 Jun 2023 18:19:38 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=IIQSJ74c; spf=pass (imf24.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=1686161978; 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=j4nCFaB26+d3BAqYMGCEUtE0haNDWw/v6nG/gtBUih4Dg3BpCyZUbs2BOITN6bFqu+C4co oHrxAU4uqcK7L1dtYwnqqx7faU6j30kqXP4p6TEWBU1RUUwyowtfmSAodtrwHHoqXNQxN/ V/6uKB/Ao1Pe68l6ZVo646k7oOhTMbU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686161978; a=rsa-sha256; cv=none; b=PWREkA5AIU6rYl07+K21yGKyzwcxIMlXSY2I3YP6X0/LlPh2ME22xAJOAXMmTXG+52NuKV 4svdlVzgyJ9ZlyQW7uvxsBDd+7bI9H6zzDcZYQ7G2Wki07WoPGTcA1Ce7UddN6q/FvSOL6 ssbAJOR2hHKM34IEwYxb8V0brb3qu4U= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=IIQSJ74c; spf=pass (imf24.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=1686161977; 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=IIQSJ74cThUV6q8f4+cjn1KMy3qlaDW8OtssUV7XbarLHW9PsdyP1r2F6xY6pUkN1uecDy IM+etLPidkb42derRtlGR3C5KarkOU6uT7oCKa+BPqJ735dUEXL+wDsGaR7lHCkbP8hrHd jW0VwxmnhuymIfXxDtWYh0rFQaq2YAw= 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-412-TTybqZy5N2KGRf1jLAwqPg-1; Wed, 07 Jun 2023 14:19:35 -0400 X-MC-Unique: TTybqZy5N2KGRf1jLAwqPg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0B408101A58B; Wed, 7 Jun 2023 18:19:33 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94E792026D49; Wed, 7 Jun 2023 18:19:30 +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 v6 02/14] tls: Allow MSG_SPLICE_PAGES but treat it as normal sendmsg Date: Wed, 7 Jun 2023 19:19:08 +0100 Message-ID: <20230607181920.2294972-3-dhowells@redhat.com> In-Reply-To: <20230607181920.2294972-1-dhowells@redhat.com> References: <20230607181920.2294972-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Stat-Signature: dupntx5jaxpza5d4spsfyn1kxb9yt3hf X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 80EB8180021 X-Rspam-User: X-HE-Tag: 1686161978-272714 X-HE-Meta: U2FsdGVkX1/R/T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wVJSajK05gVeO8m8hz+NRTjiiJ+PQVA/su/9fldtVLdPO4gWJZKO9YYVmx8PLbhBUqHCMGBZjzL5uPtArhbj9BjdzB/jMTcaCGgbDsK8Utug9RT97xQCpRT1BfJkVJ2KQRFsqdTFVCgz+/O1lwYGxjAUsO8Y6TUHxsT5qW/bkhZ538YlOSD6E80kTgocmucLUcCk3AbUhhpc+5HlCBfKmQrk5EeeTeuErMgihfvJIecNHkTI8dtZcu5A3gwLSxLyVzJAWftBLpzL5y+AhHv76NQrZ1aJmec43JFWsCVkOt3mshTvDVt4CvhiDW1GGi1GI6KVL5mLzwC1zJH5VJGA1hC0j3zeucycnoEvgprwJg7EJZ4EPXpORx5L0V0JX3pe9QxhCCRYd0GzP9tCssPZOyy9QU7IMFFP8S2JvCkmHhKH/WyUA8FAKayDzeahtFHA== 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);