Re: [PATCH] SUNRPC: Make svcauth_gss sequence-number window size tunable
From: Fredrik Tolf
Date: Mon Nov 23 2026 - 11:27:06 EST
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?
--
Fredrik Tolf