Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11937933rwl; Tue, 3 Jan 2023 06:56:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXt5ljq2DxYjMWk9tFy+cSDCneQx2qWDUhCvCCoWp/kIYFYMAsxacrEz0xMcon1e99X3B008 X-Received: by 2002:a05:6a20:c18d:b0:ad:c694:5956 with SMTP id bg13-20020a056a20c18d00b000adc6945956mr53173449pzb.62.1672757804440; Tue, 03 Jan 2023 06:56:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672757804; cv=none; d=google.com; s=arc-20160816; b=J6c+RX6rFq9XCjqnB6hnZo1A8qLZ4DQ+eEUM9yV+2oYoHvNIlmWCsAME025Zm8rJh/ Kiivk/kNvBzEfLjNDoCFEb6/bjupVUhd2ubMpKvBDpuug7FSJ6iohGLsvP+jmfsmFFXR 7kNHhcJk3bhIwcrLB1OEP68VV3/NvNosu7/aprbOKfBROB7IJEu1ssm60eRflIqTZDCA dZ+h0lAaZ6R5aiX3TjZ2wEofQeswcjGGbvL03R4D0Xw4pEAeqs0WDHjtfN4K7BghgTN+ uIqEPL0EmeibXrpqdHHuK8h5qXTcqMwcQ/M/fWlbDRT1RQbQ2sB9zWZzpLlARPkttFFg HraQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:to:from :subject:message-id:dkim-signature; bh=PgG2rMl0C0CQoqlA8vRjOH5UDOfgZyWrdSF7f/sbVIo=; b=JXQdty1g2x3weyq1ooUZp5X0qW3K9Hdpodx8A6H+bFhDvjWMXPy1sjwrBEa4UNnUGT j2PqymjkMrNguSt35m0/094HpwJkg5ZlOOpEk87/MvnKkbla176oeIMnNM5fb6TtUjxB AQZW/CCZFPCOlv7mI4fl3NC8emyWcVXx36TWa6PFZF/ikedRrmZppCBbSIMNHo4EQ7TF 99c2+KoWUInWCwYhNeS0Z1op453A4TGvajPNkXTjAGi37UE83i3MnWNh4ArZ6anrhOLO /r516MlA8FTDmmg51NptbChuo1Dqc85HdMyPL+xMmhiWbVbnwpz8OO/Gv74m75ELpCv4 NJsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="B0fN9/jb"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h64-20020a638343000000b004a445c22f84si3294842pge.710.2023.01.03.06.56.23; Tue, 03 Jan 2023 06:56:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="B0fN9/jb"; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237290AbjACOwN (ORCPT + 99 others); Tue, 3 Jan 2023 09:52:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238051AbjACOwG (ORCPT ); Tue, 3 Jan 2023 09:52:06 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2FBEEE1E for ; Tue, 3 Jan 2023 06:52:05 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 524A3B80F99 for ; Tue, 3 Jan 2023 14:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0CECC433EF; Tue, 3 Jan 2023 14:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672757523; bh=/OpHo+Yq3vUKiy3k0OhVuXclnih6jCTXeAgRXXf3qYQ=; h=Subject:From:To:Date:In-Reply-To:References:From; b=B0fN9/jbok7qwmmuSCoslCsds9lMjziy8MtKwB/RJ/isBncuT4PVRzPgJc2J0FZlG l/R4FkUx8vs6Cf7S8h1f/DLKuBOKDpN/B5G0SyQn4mCLQqMnT7Hl9cG0GiOeSqKHUD NkTE+8MvLX49NsRcM55CNZrWQHmHUfuoICevtN0CqRt1MxbbmJlWObxEfZwp5JLm8+ /mwbGfyaep5PYcGKCHvAbwXrf82jSVF/ldQo4iAEQxoNL186wFenqhSgQctmNlS0Ub oaMzMW7/oImaZlmMXLQN5BCFaY3VShhEbZ3Brkt6+PMPhaiPGureoLaWf3s7O0sc7Q wyvQdO1/1VIug== Message-ID: <159dd1253c7b49b6654cb4373477f69cc7387b1e.camel@kernel.org> Subject: Re: [PATCH v1 00/25] Server-side RPC call header parsing overhaul From: Jeff Layton To: Chuck Lever , linux-nfs@vger.kernel.org Date: Tue, 03 Jan 2023 09:52:01 -0500 In-Reply-To: <167267753484.112521.4826748148788735127.stgit@manet.1015granger.net> References: <167267753484.112521.4826748148788735127.stgit@manet.1015granger.net> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.2 (3.46.2-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, 2023-01-02 at 12:05 -0500, Chuck Lever wrote: > Happy new year, campers. >=20 > The following series has been percolating for quite a while, thanks > to the extended 6.1-rc cycle. I'd like to get this work reviewed > for possible inclusion in v6.3, so I'm starting early. >=20 > The purpose of this series is to replace the svc_get* macros in the > Linux kernel server's RPC call header parsing code with xdr_stream > helpers. I've measured no change in CPU utilization after the > overhaul; svc_recv() and friends remain the highest CPU consumers by > an order of magnitude. >=20 > Memory safety: Buffer bounds checking after decoding each XDR item > is more memory-safe than the current decoding mechanism. Subsequent > memory safety improvements to the xdr_stream helpers will benefit > all who use them. >=20 > Audit friendliness: The new code has lots of comments and other > clean-up to help align it with the relevant RPC specifications. The > use of common helpers also makes the decoders easier to audit. >=20 > I've split the full series in half to make it easier to review. The > patches posted here handle RPC call header decoding. Remaining > patches, to be posted later, deal with RPC reply header encoding. >=20 > Yes, there are a lot of patches, but they are each small, easily > chewed mechanical changes. >=20 > --- >=20 > Chuck Lever (25): > SUNRPC: Push svcxdr_init_decode() into svc_process_common() > SUNRPC: Move svcxdr_init_decode() into ->accept methods > SUNRPC: Add an XDR decoding helper for struct opaque_auth > SUNRPC: Convert svcauth_null_accept() to use xdr_stream > SUNRPC: Convert svcauth_unix_accept() to use xdr_stream > SUNRPC: Convert svcauth_tls_accept() to use xdr_stream > SUNRPC: Move the server-side GSS upcall to a noinline function > SUNRPC: Hoist common verifier decoding code into svcauth_gss_proc_i= nit() > SUNRPC: Remove gss_read_common_verf() > SUNRPC: Remove gss_read_verf() > SUNRPC: Convert server-side GSS upcall helpers to use xdr_stream > SUNRPC: Replace read_u32_from_xdr_buf() with existing XDR helper > SUNRPC: Rename automatic variables in unwrap_integ_data() > SUNRPC: Convert unwrap_integ_data() to use xdr_stream > SUNRPC: Rename automatic variables in unwrap_priv_data() > SUNRPC: Convert unwrap_priv_data() to use xdr_stream > SUNRPC: Convert gss_verify_header() to use xdr_stream > SUNRPC: Clean up svcauth_gss_accept's NULL procedure check > SUNRPC: Convert the svcauth_gss_accept() pre-amble to use xdr_strea= m > SUNRPC: Hoist init_decode out of svc_authenticate() > SUNRPC: Re-order construction of the first reply fields > SUNRPC: Eliminate unneeded variable > SUNRPC: Decode most of RPC header with xdr_stream > SUNRPC: Remove svc_process_common's argv parameter > SUNRPC: Hoist svcxdr_init_decode() into svc_process() >=20 >=20 > fs/lockd/svc.c | 1 - > fs/nfs/callback_xdr.c | 1 - > fs/nfsd/nfssvc.c | 1 - > include/linux/sunrpc/msg_prot.h | 5 + > include/linux/sunrpc/xdr.h | 5 +- > net/sunrpc/auth_gss/svcauth_gss.c | 512 ++++++++++++++++-------------- > net/sunrpc/svc.c | 69 ++-- > net/sunrpc/svc_xprt.c | 1 - > net/sunrpc/svcauth.c | 13 +- > net/sunrpc/svcauth_unix.c | 132 +++++--- > net/sunrpc/xdr.c | 50 ++- > 11 files changed, 468 insertions(+), 322 deletions(-) >=20 > -- > Chuck Lever >=20 I went through the whole set and it's all a mostly logical set of methodical changes. You can add: Reviewed-by: Jeff Layton