freebsd-src/sys/fs
Rick Macklem 501bdf3001 nfscl: newnfs_copycred() cannot be called when a mutex is held
Since newnfs_copycred() calls crsetgroups() which in turn calls
crextend() which might do a malloc(M_WAITOK), newnfs_copycred()
cannot be called with a mutex held.  Fortunately, the malloc()
call is rarely done, since XU_GROUPS is 16 and the NFS client
uses a maximum of 17 (only 17 groups will cause the malloc() to
be called).  Further, it is only a problem if the malloc() tries
to sleep().  As such, this bug does not seem to have caused
problems in practice.

This patch fixes the one place in the NFS client where
newnfs_copycred() is called while a mutex is held by moving the
call to after where the mutex is released.

Found by inspection while working on an experimental patch.

MFC after:	2 weeks
2023-11-06 14:25:30 -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-21 11:51:12 -05:00
ext2fs Fix build with gcc12. 2023-10-27 16:39:12 -07:00
fdescfs Fix MNT_IGNORE for devfs, fdescfs and nullfs 2023-08-26 12:08:37 +01:00
fifofs sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
fuse fusefs: sanitize FUSE_READLINK results for embedded NULs 2023-10-07 08:22:03 -06: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/kgssapi: Fix Kerberized NFS mounts to pNFS servers 2023-10-23 13:21:14 -07:00
nfsclient nfscl: newnfs_copycred() cannot be called when a mutex is held 2023-11-06 14:25:30 -08:00
nfsserver nfsd: Fix NFSv4.1/4.2 Claim_Deleg_Cur_FH 2023-10-19 12:35:35 -07:00
nullfs Fix MNT_IGNORE for devfs, fdescfs and nullfs 2023-08-26 12:08:37 +01:00
procfs sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
pseudofs Remove my middle name. 2023-08-17 15:08:30 +02: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