Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp530330iof; Mon, 6 Jun 2022 08:01:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgO0C9j/B1m/1q2dOEpUI5sLOeP5gXvOB+uwjRFPQndzniMc+gIIO3pBWT0+M8x4cY6tKj X-Received: by 2002:a05:6a00:2293:b0:51c:155a:1868 with SMTP id f19-20020a056a00229300b0051c155a1868mr6769642pfe.79.1654527698795; Mon, 06 Jun 2022 08:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654527698; cv=none; d=google.com; s=arc-20160816; b=rJIv6zxvqQtQHXEYrXqpvXoU+0eMpQ24oY/L4OymLT5H88fmCwTTBRTIkB5udYyGDx p7o14OHVC32DFFUfUOqSrCT7GfwneItGPxVE9oCxNbNGiXk5mZ+vYW4T3dQzarJ2eKnW lt9iBVs2n2nSflil0yz6KxJWYZuTFu+5C31ZxDoGsm/HqiL2OpYzRt9PUJzD8DXS1+7F ZmMPpTwLZUxNPhm/UpeIimpQ3R3gfJgwtM4TT++NpsvJLZUeJ9uo2wPguMF7X0iqVN9/ Ys/UgIxU357Lw8+qxBKyBbY+CHndBAlRWfDJhbDcd5+eJIZsmJqgEMOeWl063ukk77+d mz0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject; bh=n8GP6KJlVVonAkPeDAIie4L0xuTb277fl08MXzhXm3k=; b=l+XN7QIsAHiVvziPgwYbGg1t9Za/6BwaY1isOYAD63ZD61bmFV1W/RKDA1eZHm3lvb pjAlK3wTO3rVEwk6Hm0c5OS2fmc57QRETpVHPcnxmQ3wNjLnSpHCh6iKV3R1SUk2KUAX Q68Yp77x8+YhuXSDMgKx2Su431ATd7Vi8/WfSPNZAqMlJbJ7nYI9cxTKRYNNyrUYBp6Z CvxJiuXn1y0M2/HeMFbF3rlT+WbO0WKu3A9f+XWE13ZDC/rqGAVs0qABuIphS55BR5ip r24Y45bPAW/HgGs/5vw4LF9ObtID6ubkCXah8Xp6gm88r7sJqjRP5qFIgavbOe6Si3jY G4/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q14-20020a632a0e000000b003fd69ac1f4asi9975021pgq.873.2022.06.06.08.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:01:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3E0991053EC; Mon, 6 Jun 2022 07:50:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240026AbiFFOud (ORCPT + 99 others); Mon, 6 Jun 2022 10:50:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240011AbiFFOub (ORCPT ); Mon, 6 Jun 2022 10:50:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6585703F9 for ; Mon, 6 Jun 2022 07:50:30 -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 81B0A614AF for ; Mon, 6 Jun 2022 14:50:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C57D3C34115; Mon, 6 Jun 2022 14:50:29 +0000 (UTC) Subject: [PATCH v2 00/15] RPC-with-TLS client side From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: trondmy@hammerspace.com Date: Mon, 06 Jun 2022 10:50:28 -0400 Message-ID: <165452664596.1496.16204212908726904739.stgit@oracle-102.nfsv4.dev> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Now that the initial v5.19 merge window has closed, it's time for another round of review for RPC-with-TLS support in the Linux NFS client. This is just the RPC-specific portions. The full series is available in the "topic-rpc-with-tls-upcall" branch here: https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git I've taken two or three steps towards implementing the architecture Trond requested during the last review. There is now a two-stage connection establishment process so that the upper level can use XPRT_CONNECTED to determine when a TLS session is ready to use. There are probably additional changes and simplifications that can be made. Please review and provide feedback. I wanted to make more progress on client-side authentication (ie, passing an x.509 cert from the client to the server) but NFSD bugs have taken all my time for the past few weeks. Changes since v1: - Rebased on v5.18 - Re-ordered so generic fixes come first - Addressed some of Trond's review comments --- Chuck Lever (15): SUNRPC: Fail faster on bad verifier SUNRPC: Widen rpc_task::tk_flags SUNRPC: Replace dprintk() call site in xs_data_ready NFS: Replace fs_context-related dprintk() call sites with tracepoints SUNRPC: Plumb an API for setting transport layer security SUNRPC: Trace the rpc_create_args SUNRPC: Refactor rpc_call_null_helper() SUNRPC: Add RPC client support for the RPC_AUTH_TLS auth flavor SUNRPC: Ignore data_ready callbacks during TLS handshakes SUNRPC: Capture cmsg metadata on client-side receive SUNRPC: Add a connect worker function for TLS SUNRPC: Add RPC-with-TLS support to xprtsock.c SUNRPC: Add RPC-with-TLS tracepoints NFS: Have struct nfs_client carry a TLS policy field NFS: Add an "xprtsec=" NFS mount option fs/nfs/client.c | 14 ++ fs/nfs/fs_context.c | 65 +++++-- fs/nfs/internal.h | 2 + fs/nfs/nfs3client.c | 1 + fs/nfs/nfs4client.c | 16 +- fs/nfs/nfstrace.h | 77 ++++++++ fs/nfs/super.c | 7 + include/linux/nfs_fs_sb.h | 5 +- include/linux/sunrpc/auth.h | 1 + include/linux/sunrpc/clnt.h | 15 +- include/linux/sunrpc/sched.h | 32 ++-- include/linux/sunrpc/xprt.h | 2 + include/linux/sunrpc/xprtsock.h | 4 + include/net/tls.h | 2 + include/trace/events/sunrpc.h | 157 ++++++++++++++-- net/sunrpc/Makefile | 2 +- net/sunrpc/auth.c | 2 +- net/sunrpc/auth_tls.c | 120 +++++++++++++ net/sunrpc/clnt.c | 34 ++-- net/sunrpc/debugfs.c | 2 +- net/sunrpc/xprtsock.c | 310 +++++++++++++++++++++++++++++++- 21 files changed, 805 insertions(+), 65 deletions(-) create mode 100644 net/sunrpc/auth_tls.c -- Chuck Lever