From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0410C77B7C for ; Sat, 27 May 2023 01:13:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbjE0BNn (ORCPT ); Fri, 26 May 2023 21:13:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbjE0BNl (ORCPT ); Fri, 26 May 2023 21:13:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE05218D for ; Fri, 26 May 2023 18:13:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 49B1D63FD0 for ; Sat, 27 May 2023 01:13:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12EE4C433EF; Sat, 27 May 2023 01:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685150019; bh=bnZn/fQHYsSl0pv4U7PItA9rlBxxlQgsJQwYXNj4rNk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=T0S4ZXibwLE948S8DRkzaDSL0v6FqP/y6telzB9wrL9huYI6cKGaMzFhOr+Pgqhyr L52M64xyEB3qyUrRqc9lOSlGxwf8O/Evs//Dr8tmDSQ5zDmrZSjnSFtpG+SvcbGg21 AlC2Dd7CT/iaW9EuBn6kFNvboA3TIQ+KXblFHF/ZJWEAvn8cEmp2EQmcyMYtlxhJGH znZxp/KUtnS5hM/pWGE7sp+VZD+tvEC2616y+RGcnb2UuXbhkalLlcRbIuArJ6AKs/ vLIopOHNRkuWFx1VTcwciH0SAVhfg8LT6eOvHa0PhwGMsvVJXNSOHDEr7blO/kBIep 049T+tKPBZfvQ== Date: Fri, 26 May 2023 18:13:38 -0700 From: Jakub Kicinski To: David Howells Cc: netdev@vger.kernel.org, "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, Chuck Lever , Boris Pismenny , John Fastabend Subject: Re: [PATCH net-next 10/12] tls/sw: Convert tls_sw_sendpage() to use MSG_SPLICE_PAGES Message-ID: <20230526181338.03a99016@kernel.org> In-Reply-To: <20230524153311.3625329-11-dhowells@redhat.com> References: <20230524153311.3625329-1-dhowells@redhat.com> <20230524153311.3625329-11-dhowells@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 24 May 2023 16:33:09 +0100 David Howells wrote: > Convert tls_sw_sendpage() and tls_sw_sendpage_locked() to use sendmsg() > with MSG_SPLICE_PAGES rather than directly splicing in the pages itself. > > [!] Note that tls_sw_sendpage_locked() appears to have the wrong locking > upstream. I think the caller will only hold the socket lock, but it > should hold tls_ctx->tx_lock too. Lock ordering, as you probably discovered. It is what it is :| > + if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | > + MSG_CMSG_COMPAT | MSG_SPLICE_PAGES | > + MSG_SENDPAGE_NOTLAST | MSG_SENDPAGE_NOPOLICY)) > + return -EOPNOTSUPP; Now MSG_SENDPAGE_* can leak in thru the sendmsg() call? Letting MSG_SENDPAGE_NOPOLICY in seems pretty suspicious, no?