nfsd: initialise nfsd_info.mutex early.
authorNeilBrown <neilb@suse.de>
Mon, 24 Jun 2024 23:04:56 +0000 (09:04 +1000)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 25 Jun 2024 14:15:39 +0000 (10:15 -0400)
commite0011bca603c101f2a3c007bdb77f7006fa78fb1
tree063fd108f42813ad412cb6bb5907f138e7418b17
parentda2c8fef130ec7197e2f91c7ed70a8c5bede4bea
nfsd: initialise nfsd_info.mutex early.

nfsd_info.mutex can be dereferenced by svc_pool_stats_start()
immediately after the new netns is created.  Currently this can
trigger an oops.

Move the initialisation earlier before it can possibly be dereferenced.

Fixes: 7b207ccd9833 ("svc: don't hold reference for poolstats, only mutex.")
Reported-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Closes: https://lore.kernel.org/all/c2e9f6de-1ec4-4d3a-b18d-d5a6ec0814a0@linux.ibm.com/
Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsctl.c
fs/nfsd/nfssvc.c