linux-yocto/fs/nfsd
Li Lingfeng 5060e1a5fe nfsd: Initialize ssc before laundromat_work to prevent NULL dereference
commit b31da62889 upstream.

In nfs4_state_start_net(), laundromat_work may access nfsd_ssc through
nfs4_laundromat -> nfsd4_ssc_expire_umount. If nfsd_ssc isn't initialized,
this can cause NULL pointer dereference.

Normally the delayed start of laundromat_work allows sufficient time for
nfsd_ssc initialization to complete. However, when the kernel waits too
long for userspace responses (e.g. in nfs4_state_start_net ->
nfsd4_end_grace -> nfsd4_record_grace_done -> nfsd4_cld_grace_done ->
cld_pipe_upcall -> __cld_pipe_upcall -> wait_for_completion path), the
delayed work may start before nfsd_ssc initialization finishes.

Fix this by moving nfsd_ssc initialization before starting laundromat_work.

Fixes: f4e44b3933 ("NFSD: delay unmount source's export after inter-server copy completed.")
Cc: stable@vger.kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:08:44 +01:00
..
acl.h
auth.c cred: get rid of CONFIG_DEBUG_CREDENTIALS 2023-12-20 17:01:51 +01:00
auth.h
blocklayout.c
blocklayoutxdr.c NFSD: da_addr_body field missing in some GETDEVICEINFO replies 2023-08-29 17:45:22 -04:00
blocklayoutxdr.h
cache.h nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:04:23 +02:00
current_stateid.h
export.c nfsd: Revert "nfsd: release svc_expkey/svc_export with rcu_work" 2025-01-02 10:32:00 +01:00
export.h nfsd: Revert "nfsd: release svc_expkey/svc_export with rcu_work" 2025-01-02 10:32:00 +01:00
filecache.c nfsd: add list_head nf_gc to struct nfsd_file 2025-01-23 17:21:19 +01:00
filecache.h nfsd: add list_head nf_gc to struct nfsd_file 2025-01-23 17:21:19 +01:00
flexfilelayout.c
flexfilelayoutxdr.c NFSD: da_addr_body field missing in some GETDEVICEINFO replies 2023-08-29 17:45:22 -04:00
flexfilelayoutxdr.h
idmap.h
Kconfig nfs: add missing selections of CONFIG_CRC32 2025-04-25 10:45:46 +02:00
lockd.c
Makefile
netns.h NFSD: Limit the number of concurrent async COPY operations 2024-11-22 15:38:36 +01:00
nfs2acl.c nfsd: clear acl_access/acl_default after releasing them 2025-02-21 13:57:06 +01:00
nfs3acl.c nfsd: clear acl_access/acl_default after releasing them 2025-02-21 13:57:06 +01:00
nfs3proc.c nfsd: handle failure to collect pre/post-op attrs more sanely 2023-08-29 17:45:22 -04:00
nfs3xdr.c
nfs4acl.c nfsd: inherit required unset default acls from effective set 2023-08-29 17:45:22 -04:00
nfs4callback.c NFSD: fix hang in nfsd4_shutdown_callback 2025-02-21 13:57:06 +01:00
nfs4idmap.c nfsd: call cache_put if xdr_reserve_space returns NULL 2024-10-04 16:29:35 +02:00
nfs4layouts.c
nfs4proc.c nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request 2025-06-27 11:08:44 +01:00
nfs4recover.c NFSD: Cap the number of bytes copied by nfs4_reset_recoverydir() 2024-12-09 10:32:30 +01:00
nfs4state.c nfsd: decrease sc_count directly if fail to queue dl_recall 2025-04-25 10:45:46 +02:00
nfs4xdr.c NFSD: Fix NFSv4's PUTPUBFH operation 2024-10-10 11:57:53 +02:00
nfscache.c nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:04:23 +02:00
nfsctl.c nfsd: make svc_stat per-network namespace instead of global 2024-08-19 06:04:24 +02:00
nfsd.h nfsd: remove nfsd_stats, make th_cnt a global counter 2024-08-19 06:04:24 +02:00
nfsfh.c nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:04:23 +02:00
nfsfh.h nfs: add missing selections of CONFIG_CRC32 2025-04-25 10:45:46 +02:00
nfsproc.c
nfssvc.c nfsd: Initialize ssc before laundromat_work to prevent NULL dereference 2025-06-27 11:08:44 +01:00
nfsxdr.c
pnfs.h
state.h
stats.c nfsd: make svc_stat per-network namespace instead of global 2024-08-19 06:04:24 +02:00
stats.h nfsd: make svc_stat per-network namespace instead of global 2024-08-19 06:04:24 +02:00
trace.c
trace.h NFSD: Fix nfsd_clid_class use of __string_len() macro 2024-04-03 15:28:35 +02:00
vfs.c nfsd: map the EBADMSG to nfserr_io to avoid warning 2024-10-10 11:57:52 +02:00
vfs.h nfsd: Handle EOPENSTALE correctly in the filecache 2023-11-20 11:58:52 +01:00
xdr.h
xdr3.h
xdr4.h NFSD: Limit the number of concurrent async COPY operations 2024-11-22 15:38:36 +01:00
xdr4cb.h