opnsense-src/sys/fs
Rick Macklem dabf1797a7 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)
2024-01-01 17:20:17 -08:00
..
autofs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
cd9660 sys: Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:17 -06:00
cuse sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
deadfs sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
devfs devfs: add integrity asserts for cdevp_list 2023-09-27 19:46:38 -05:00
ext2fs Fix build with gcc12. 2023-10-31 08:59:28 -07:00
fdescfs sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fifofs sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
fuse vn_copy_file_range(): provide ENOSYS fallback to vn_generic_copy_file_range() 2023-12-05 02:43:27 +02:00
mntfs sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
msdosfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
nfs nfscl: Fix handling of expired Kerberos credentials (NFSv4.1/4.2) 2024-01-01 17:20:17 -08:00
nfsclient nfscl: Make NFSv4.2 Copy set atime on infd 2023-12-29 15:18:14 -08:00
nfsserver nfsd: Avoid acquiring a vnode for some NFSv4 Readdir operations 2023-11-16 15:46:17 -08:00
nullfs nullfs: do not allow bypass on copy_file_range() 2023-12-05 02:43:27 +02:00
procfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
pseudofs pseudofs: fix off by one in hash iteration in pfs_purge 2023-11-24 17:22:15 +00:00
smbfs sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
tarfs vfs: use __enum_uint8 for vtype and vstate 2023-07-05 15:06:30 +00:00
tmpfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
udf sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
unionfs sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00