From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796240834; b=b7td2cymQAWKIpgDVRdBEYuKWtTrDO2kumb+M1SItNy5rucY2BS6hZm/aSswNmmN4Ap1 j8/0BUKhoytw1ze4RT1e7B4SNMRoOJQX4LigfXT08INDeko1rgiskpv+q1i1vTplNOZqg tIC0vpeu59iz84yeA082UTvFbxF39ncqpS2XPr0K9iHOGtAXRb+UDoklTbmIElcEUijL0 m1e/6hiZLP/U+Ql0NGQGEnKFBMZTFLx/qcYYAMFLau9uCC3F5g7niB5hdLz8QYZGV8VzK h/f8VZsqb63Gw0fPFMkDUZtckSRY2NfV1WDMpWSoFm+n6IJCJoEybZNGmiLFf/t+5IQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796240834; h=Received:DKIM-Signature:Received:Received:X-ME-Sender: X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer: MIME-Version:X-ThreadId:Date:From:To:Cc:Message-Id:In-Reply-To: References:Subject:Content-Type:Content-Transfer-Encoding; bh=hSjwd8WPZB6Cy9KBCeb12vhTbWbKTH4rrYh39Afr2sI=; b=NBcOgOgBJJjeq5V+SRBNWkTlCHmfUnYPqIk/sqi98AuHSB6C70aj+VzILzuye+CPfHp5 MMUM2omaqJRXQmkZdb1Cr8qwpOkKsxQJItie90lXQXIcllRj+YYLWHGJ+/IH/DWpoaNee hvCkClQCWl4FkE9qSZCeVQ1UiNQOqZy3jHTLAayg4KKg+A760dFoGDkPTJ3P+iZwNK3Ny liXhTewHnyT9QWQO1ROs/UvDSz8GXnetOnQRiY5EktiHqS/skj49IDfUf9ff6XOTAL/0F LlajoxS2X9jD43ZLM2pBkJpXqTX/YrvLyblurW1y2BrYuRDTWB36RozR+44Lz7g5rdg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=M97O8cYD; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14821606A322; Wed, 2 Dec 2026 19:47:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=M97O8cYD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72EB11F0089F; Wed, 2 Dec 2026 19:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796240833; bh=hSjwd8WPZB6Cy9KBCeb12vhTbWbKTH4rrYh39Afr2sI=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=M97O8cYDks5Wijqtr/vuiKoVwGfBXAhnYXLuV/KZOODZweQ4H1qvdDdoSERBofZdf uXDVzxMtkkDCvu7/YgBrFK2hF75+guC8WIyzLNZuyz0VO4uNQ8l0mJulZYRXoWE95R wcvSbTQuB/FLQ3RPDP9LZlOE01j2rh422a7qeuJ2VfelEk7IlIXHOt8EAFgOHq9yJy m0SKk/W8TzS3BSrebvlVARUP9zx0DYRMl+ZKvggU+TG1F6rMPC69BbwGUn6MG5No+d 2xmh4Vd0HH3yCgKFmDFSwC6o5YkpQWt/cVDRM0sf5Z6v38Aohn5I684fuc9UwECQv0 7lyoeKcfQVuEA== Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfauth.phl.internal (Postfix) with ESMTP id BF0FDF40068; Wed, 2 Dec 2026 14:47:12 -0500 (EST) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-10.internal (MEProxy); Wed, 02 Dec 2026 14:47:12 -0500 X-ME-Sender: X-ME-Proxy-Cause: dmFkZTGRxj4Lv7tk69dJAOekPhDcsWVaFBDNkLI3HAGsGlyMEzSK88sYhLoJohaktSKdtx POhCOb8vqMzRTGVwyZF4h7aWAbH8nQk10makuriZNEC+kJJargUn89j37S+AMJTRRzbNeb QEDZNwayh3mBT124qqnpmPDkMNPKBZtYaUH3/SNtU5Ne7tYWuTtkpsVwxK1jaIO2T1KgaG aVqEixmbMrMBJ4351Y8M1vFrJcqSv2Jf4V1uamzXStcx8sevPxwr9fYRhu8HCt1g4rlRpU AFvYRDF+cgA9RS9YTbu9w/+SmhSX1OO8hBUEbrymoz8/qTTZZ7D8RyAErrF2Y5nlIIi3b4 3sDw6qCwRA69CSlM647sNiwAP3IBSKeT/UInXRaFwFgzdzJLNA4oxvja4uwmPrUFEiVIGf TojqL2NZpUPgc+M/vQsWG/ERAVWk3g2evj/1AW+9Pnv3p+EIHHUMEgP3jbI7WK6+meaxGL SaOpCxmaXDUpES3ErN72OXRB1E/Bz+5RZfcwitQBTX0x3IdrlQuYBcqGtLasucrp9RLgcH HGz1/nV1k+bI2RSw3nznwNrwCfeYggq3/GnbKCiz7jMeABH9QX+KQ++dgdw8AN8dcCCOCf nNO1azcdmdY5fdvmPfTtBaweaX2flbdjPdy5qE+tS0v294XMXcNGXc7wv3XQ X-ME-Proxy: Feedback-ID: ifa6e4810:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A4B32780070; Wed, 2 Dec 2026 14:47:12 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-ThreadId: AAoF7yJtL20o Date: Wed, 02 Dec 2026 14:46:02 -0500 From: "Chuck Lever" To: "Fredrik Tolf" Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: <4d7ef5ff-5e24-4f9e-b904-16e5cc3251a2@app.fastmail.com> In-Reply-To: References: <20261123005648.29562-1-fredrik@dolda2000.com> <9f8f700f-a10f-4aff-a385-4300c8164f1b@app.fastmail.com> Subject: Re: [PATCH] SUNRPC: Make svcauth_gss sequence-number window size tunable Content-Type: text/plain Content-Transfer-Encoding: 7bit On Mon, Nov 23, 2026, at 11:26 AM, Fredrik Tolf wrote: > On Mon, 23 Nov 2026, Chuck Lever wrote: >> I don't think this is a SunRPC scheduling problem. Rather it's that the >> crypto handling sometimes takes a while (and I don't know why that is) >> and that delays one RPC just enough to trigger the sequence number >> window check. > > I think that it is. I reckon that, since nfsd handles requests > concurrently, there are no particular ordering guarantees on the sequence > number checks. While it's true that the particularly long time that the > MIC verification can take seems to be the actual cause of the issue in > these cases, I don't think making that go away would be an actual > root-cause fix. > > As I mentioned, I considered other heuristic solutions -- one of them was > to effectively hold a lock during the MIC+seqnum check, or other > mechanisms that would compensate for the time the MIC verification might > take, but in the end I didn't consider them technically correct either. > Again, since the request processing is concurrent, I reckon that, while > much more unlikely, there could be other scheduling issues (ECC/MCE > hickups, interrupt storms, &c&c) that could delay a particular nfsd thread > from even reaching svcauth_gss_verify_header before the window has already > excluded it by the work of other, faster-working threads. A *lot* less > likely, yes, but still hard to consider technically correct and fixing > the root cause, no? > > As I said, in a UDP context, I imagine this wouldn't be a problem, since > the failing packet would just be considered lost and retransmitted, but > that's not how things happen over TCP. Unless a TCP connection can also be > made to just consider such requests lost and having them retransmitted > later instead of closing the channel, I imagine the only real root-cause > fix is to serialize the GSS verifier checks, so that they happen in TCP > stream order, and that seems quite difficult to do given the asynchronous > nature of the sunrpc servicing implementation, which is why it comes back > to a scheduling problem. > > Again, since I considered that problem quite difficult to solve, that's > why I suggested this solution in the interim, just because I'm sitting > with disconnection storms on my home network that sometimes makes it very > difficult to get anything done. ;) > > At least that's how I analyzed it, but I'm really not familiar with the > NFS/sunrpc code; I'm normally just an ordinary home user of it. Thoughts? I've made some time to investigate the issue again. The crypto functions are not the source of the extra latency, agreed. Dequeuing incoming messages from the transport endpoint happens in received order, but the nfsd threads that pick up that work can run in any order. (What confused me about your original suggestion was "sunrpc" and "scheduling" in the same sentence: here, it's the kernel's scheduler that chooses which nfsd thread to awaken). The behavior is the same for all security flavors and transports, but only GSS is impacted because it's the only flavor with an ordering constraint. There are some things that make this much worse: an underpowered NFS server, CONFIG_PREEMPT_DYNAMIC in full mode on the server, or a client sharing the same GSS context across multiple connections. It appears to impact sec=krb5 as well as krb5i and krb5p, so using Kerberos authentication-only over TLS is going to suffer from the same issue. I'm looking at various solutions, but none of them appear to close the gap entirely. But I'm still researching. Some scenarios we could try is skipping the GSS sequence number window check when TLS or NFSv4.1 sessions are in use, since inserting replays in either scenario would be detectable. But that leaves NFSv3... -- Chuck Lever