[Midnightbsd-cvs] [MidnightBSD/src] 62cb9e: nfscl: Fix handling of expired Kerberos credential...

Lucas Holt noreply at github.com
Tue Jan 9 17:23:13 EST 2024


  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: 62cb9e7d054312f4e06933758ab86fbcfe231dc9
      https://github.com/MidnightBSD/src/commit/62cb9e7d054312f4e06933758ab86fbcfe231dc9
  Author: Rick Macklem <rmacklem at FreeBSD.org>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M sys/fs/nfs/nfs_commonkrpc.c

  Log Message:
  -----------
  nfscl: Fix handling of expired Kerberos credentials (NFSv4.1/4.2)

If the NFS server detects that the Kerberos credentials provided
by a NFSv4.1/4.2 mount using sec=krb5[ip] have expired, the NFS
server replies with a krpc layer error of RPC_AUTHERROR.
When this happened, the client erroneously left the NFSv4.1/4.2
session slot busy, so that it could not be used by other RPCs.
If this happened for all session slots, the mount point would
hang.

This patch fixes the problem by releasing the session slot
and resetting its sequence# upon receiving a RPC_AUTHERROR
reply.

This bug only affects NFSv4.1/4.2 mounts using sec=krb5[ip],
but has existed since NFSv4.1 client support was added to
FreeBSD.

So, why has the bug remained undetected for so long?
I cannot be sure, but I suspect that, often, the client detected
the Kerberos credential expiration before attempting the RPC.
For this case, the client would not do the RPC and, as such,
there would be no busy session slot.  Also, no hang would
occur until all session slots are busied (64 for a FreeBSD
client/server), so many cases of the bug probably went undetected?
Also, use of sec=krb5[ip] mounts are not that common.

PR:	275905

(cherry picked from commit a558130881e9d574dc5f37827fe2284667d5aba8)




More information about the Midnightbsd-cvs mailing list