Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp4279834rba; Tue, 2 Apr 2024 12:11:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQAEhx3r13yG/Yn+oB08gR8X+gj+yZpvo3t0iz57xGI2drrU9DcZ5prUMj0bvZx2PBDG/4NtBJHCEQMJlk/LThriFJlnrIzz7mom8PHQ== X-Google-Smtp-Source: AGHT+IF4loPOa/bj6pDdIX6EyiUEiesks8qjLn0iNqTcZeRBzSF8/yslcmLMlPdEffm1qjKC88Sh X-Received: by 2002:a17:90a:4586:b0:29d:dfae:4fac with SMTP id v6-20020a17090a458600b0029ddfae4facmr11457473pjg.23.1712085067325; Tue, 02 Apr 2024 12:11:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712085067; cv=pass; d=google.com; s=arc-20160816; b=EyjuZES7myb24gl2inPSfzEDzJzntqne2jtST/sero7aYFQ+aqbjQbMymal1a695pW 7jqhlRhIApHLtFU0OnzfOZ8ENW5t2uK0SQE9fUAO8L62kDyO0/7hwso/bzaCFYFqgIBY W5q4ogYZr6DQF2KUY1rOo6xObHu2zLaLpDqjZHiNf/xjgb4Onx3iHbZ3MTEBMgzbWIFK fgnP5T0ablWoh0QJVwdCH9mwtgDEYZPx3hobGyserJ8Ah+pGA1m/n2Xpz7C9VW9f45cQ UlRpUMPHk6WGzIw6UTcH4fKAQ78aNcvcY6u1PZ4MXZ7NC+Kv+BaXhCyIFn/mx8Ru2PEK +ODA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=cKQYXbBF2r3wTa/+Wr02U6OUhZI9KOrvoqbDcTkY8e0=; fh=zrf3k9maC4LGn/MmcHhRkqh5cHnarsSKx/fWXfAmYNI=; b=lITccliSkoQdDYUVVupaVs+uKMX6PdvfriWBntQMRXOWHwhPj7SeoO0IOBzwwEJedp yAJmDE5uM6WettoaZP9TLwfdo85CnYLlZF34JDNVh460SoaAuWGse6HHlBsa50RC+BeX J1spAPdqdQdB4XOtblLSoZsrCd7y+KyS/iFpUIugIOBNWd9wclXtZX3LNdA+MdVoLR6l awHPiyOB59988eiK28X2295Gpu/2mU3izSN51zbsvJ5XDtVJG3RhmK0sMA6tw0ifw3wz vKrsiKzxZgITFRH6OUfMO8KiXfFANah7/7xmRSfP6ArqNR2LuaXgPtCTOJqadz+9YgRi Fv2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rhvXWYOi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-2604-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2604-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ls6-20020a17090b350600b002a2305f12fcsi6248364pjb.15.2024.04.02.12.11.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 12:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2604-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rhvXWYOi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-2604-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2604-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 112EBB22E29 for ; Tue, 2 Apr 2024 18:41:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17803158D7D; Tue, 2 Apr 2024 18:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rhvXWYOi" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5A48219E0 for ; Tue, 2 Apr 2024 18:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712083301; cv=none; b=L2O1F109iVMsb/VkTagNmZF8nkFPT3MACqldZIO85jM1qW1YIwfJ7Vcw+yRONjkxzIe4A4X/rDDb+FhZ3yul20j6aDm4z6zh+0saaGafCD8Z8NzePov5aEeRZ0S6qFGO3rbfLZnvNHVmUisHwUqvXzbKDgi3OIKCb6VFlqiiofQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712083301; c=relaxed/simple; bh=12PzEypO0YABKIFhDz0Yc8bi4N+hhGxjbSoQi0mC8HY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TGmdD03liF7F4F0sM8tOpodjtVvZPMJ7BHuQxcpmvt+n28v2cK6uLdniYMoAm1pQHY4rA82ewjvqicD6XLY39tcN9WgFxt23zTRnV0rH0lpFduu/97fLu1N4Qi9c6Je5QeqDP6LdNKDoop1HrJXM9TjsFus0H+5t16kE/S/C/NU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rhvXWYOi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C184C433F1; Tue, 2 Apr 2024 18:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712083300; bh=12PzEypO0YABKIFhDz0Yc8bi4N+hhGxjbSoQi0mC8HY=; h=From:To:Cc:Subject:Date:From; b=rhvXWYOi+XyynlqmMHoIRZjLk3158Scub5pXOOJM8ZhrzBWYpnm4GuTkziu3Eu8fk i0xzQOgy14QLy+Ae8W9aoCQdADa0QGju/W2InHW/nLMXvXjtXI0u7oZ6J8FH6SeG/g esC6v1+0VWLng5A4HKTmesjV89+oOzAWwDlYiYof7vZq9lRqKuPSVSSaHpr6YSDZA4 zyyaUvtt30Stzrhae7ljSG0T3s6/2IhdvVMRR4AeRHlfbXQj1LekHNqBWHUjnaYaMV tTsb+z2G5UEQVmo1EoRoQ7ASLJ52mG82Dvps2ibbIGCnugywr6Kw8gLn1DtC2Esd1l Ynu93rih/Fylw== From: Anna Schumaker To: linux-nfs@vger.kernel.org, trond.myklebust@hammerspace.com Cc: anna@kernel.org Subject: [PATCH 1/1] SUNRPC: add a missing rpc_stat for TCP TLS Date: Tue, 2 Apr 2024 14:41:38 -0400 Message-ID: <20240402184138.327897-1-anna@kernel.org> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Olga Kornievskaia Commit 1548036ef120 ("nfs: make the rpc_stat per net namespace") added functionality to specify rpc_stats function but missed adding it to the TCP TLS functionality. As the result, mounting with xprtsec=tls lead to the following kernel oops. [ 128.984192] Unable to handle kernel NULL pointer dereference at virtual address 000000000000001c [ 128.985058] Mem abort info: [ 128.985372] ESR = 0x0000000096000004 [ 128.985709] EC = 0x25: DABT (current EL), IL = 32 bits [ 128.986176] SET = 0, FnV = 0 [ 128.986521] EA = 0, S1PTW = 0 [ 128.986804] FSC = 0x04: level 0 translation fault [ 128.987229] Data abort info: [ 128.987597] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 [ 128.988169] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 128.988811] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 128.989302] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000106c84000 [ 128.990048] [000000000000001c] pgd=0000000000000000, p4d=0000000000000000 [ 128.990736] Internal error: Oops: 0000000096000004 [#1] SMP [ 128.991168] Modules linked in: nfs_layout_nfsv41_files rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace netfs uinput dm_mod nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 rfkill ip_set nf_tables nfnetlink qrtr vsock_loopback vmw_vsock_virtio_transport_common vmw_vsock_vmci_transport vsock sunrpc vfat fat uvcvideo videobuf2_vmalloc videobuf2_memops uvc videobuf2_v4l2 videodev videobuf2_common mc vmw_vmci xfs libcrc32c e1000e crct10dif_ce ghash_ce sha2_ce vmwgfx nvme sha256_arm64 nvme_core sr_mod cdrom sha1_ce drm_ttm_helper ttm drm_kms_helper drm sg fuse [ 128.996466] CPU: 0 PID: 179 Comm: kworker/u4:26 Kdump: loaded Not tainted 6.8.0-rc6+ #12 [ 128.997226] Hardware name: VMware, Inc. VMware20,1/VBSA, BIOS VMW201.00V.21805430.BA64.2305221830 05/22/2023 [ 128.998084] Workqueue: xprtiod xs_tcp_tls_setup_socket [sunrpc] [ 128.998701] pstate: 81400005 (Nzcv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) [ 128.999384] pc : call_start+0x74/0x138 [sunrpc] [ 128.999809] lr : __rpc_execute+0xb8/0x3e0 [sunrpc] [ 129.000244] sp : ffff8000832b3a00 [ 129.000508] x29: ffff8000832b3a00 x28: ffff800081ac79c0 x27: ffff800081ac7000 [ 129.001111] x26: 0000000004248060 x25: 0000000000000000 x24: ffff800081596008 [ 129.001757] x23: ffff80007b087240 x22: ffff00009a509d30 x21: 0000000000000000 [ 129.002345] x20: ffff000090075600 x19: ffff00009a509d00 x18: ffffffffffffffff [ 129.002912] x17: 733d4d4554535953 x16: 42555300312d746e x15: ffff8000832b3a88 [ 129.003464] x14: ffffffffffffffff x13: ffff8000832b3a7d x12: 0000000000000008 [ 129.004021] x11: 0101010101010101 x10: ffff8000150cb560 x9 : ffff80007b087c00 [ 129.004577] x8 : ffff00009a509de0 x7 : 0000000000000000 x6 : 00000000be8c4ee3 [ 129.005026] x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff000094d56680 [ 129.005425] x2 : ffff80007b0637f8 x1 : ffff000090075600 x0 : ffff00009a509d00 [ 129.005824] Call trace: [ 129.005967] call_start+0x74/0x138 [sunrpc] [ 129.006233] __rpc_execute+0xb8/0x3e0 [sunrpc] [ 129.006506] rpc_execute+0x160/0x1d8 [sunrpc] [ 129.006778] rpc_run_task+0x148/0x1f8 [sunrpc] [ 129.007204] tls_probe+0x80/0xd0 [sunrpc] [ 129.007460] rpc_ping+0x28/0x80 [sunrpc] [ 129.007715] rpc_create_xprt+0x134/0x1a0 [sunrpc] [ 129.007999] rpc_create+0x128/0x2a0 [sunrpc] [ 129.008264] xs_tcp_tls_setup_socket+0xdc/0x508 [sunrpc] [ 129.008583] process_one_work+0x174/0x3c8 [ 129.008813] worker_thread+0x2c8/0x3e0 [ 129.009033] kthread+0x100/0x110 [ 129.009225] ret_from_fork+0x10/0x20 [ 129.009432] Code: f0ffffc2 911fe042 aa1403e1 aa1303e0 (b9401c83) Fixes: 1548036ef120 ("nfs: make the rpc_stat per net namespace") Signed-off-by: Olga Kornievskaia --- net/sunrpc/xprtsock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index bb81050c870e..ea7bf1b4172d 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2664,6 +2664,7 @@ static void xs_tcp_tls_setup_socket(struct work_struct *work) .xprtsec = { .policy = RPC_XPRTSEC_NONE, }, + .stats = upper_clnt->cl_stats, }; unsigned int pflags = current->flags; struct rpc_clnt *lower_clnt; -- 2.43.0