linux-yocto/fs/nfsd
Li Lingfeng a97668ec6d 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:07:26 +01:00
..
acl.h
auth.c
auth.h
blocklayout.c nfsd: move nfserrno() to vfs.c 2024-03-06 14:45:15 +00:00
blocklayoutxdr.c nfsd: move nfserrno() to vfs.c 2024-03-06 14:45:15 +00:00
blocklayoutxdr.h
cache.h nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:00:05 +02:00
current_stateid.h
export.c nfsd: make sure exp active before svc_export_show 2024-12-14 19:54:16 +01:00
export.h NFSD: Fix frame size warning in svc_export_parse() 2024-08-19 06:00:04 +02:00
fault_inject.c
filecache.c nfsd: add list_head nf_gc to struct nfsd_file 2025-01-23 17:17:17 +01:00
filecache.h nfsd: add list_head nf_gc to struct nfsd_file 2025-01-23 17:17:17 +01:00
flexfilelayout.c nfsd: move nfserrno() to vfs.c 2024-03-06 14:45:15 +00:00
flexfilelayoutxdr.c
flexfilelayoutxdr.h
idmap.h
Kconfig nfs: add missing selections of CONFIG_CRC32 2025-04-25 10:43:52 +02:00
lockd.c
Makefile nfsd: allow disabling NFSv2 at compile time 2024-03-06 14:45:15 +00:00
netns.h NFSD: Limit the number of concurrent async COPY operations 2024-11-22 15:37:32 +01:00
nfs2acl.c nfsd: clear acl_access/acl_default after releasing them 2025-02-21 13:49:55 +01:00
nfs3acl.c nfsd: clear acl_access/acl_default after releasing them 2025-02-21 13:49:55 +01:00
nfs3proc.c
nfs3xdr.c
nfs4acl.c
nfs4callback.c NFSD: fix hang in nfsd4_shutdown_callback 2025-02-21 13:49:56 +01:00
nfs4idmap.c nfsd: call cache_put if xdr_reserve_space returns NULL 2024-10-17 15:21:08 +02:00
nfs4layouts.c
nfs4proc.c nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request 2025-06-27 11:07:26 +01:00
nfs4recover.c NFSD: Cap the number of bytes copied by nfs4_reset_recoverydir() 2024-12-14 19:53:47 +01:00
nfs4state.c nfsd: decrease sc_count directly if fail to queue dl_recall 2025-04-25 10:43:53 +02:00
nfs4xdr.c NFSD: Fix NFSv4's PUTPUBFH operation 2024-10-17 15:21:58 +02:00
nfscache.c nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:00:05 +02:00
nfsctl.c nfsd: drop the nfsd_put helper 2024-08-29 17:30:53 +02:00
nfsd.h nfsd: drop the nfsd_put helper 2024-08-29 17:30:53 +02:00
nfsfh.c nfsd: make all of the nfsd stats per-network namespace 2024-08-19 06:00:05 +02:00
nfsfh.h nfs: add missing selections of CONFIG_CRC32 2025-04-25 10:43:52 +02:00
nfsproc.c NFSD: Use set_bit(RQ_DROPME) 2024-03-06 14:45:17 +00:00
nfssvc.c nfsd: Initialize ssc before laundromat_work to prevent NULL dereference 2025-06-27 11:07:26 +01:00
nfsxdr.c
pnfs.h
state.h NFSD: add delegation reaper to react to low memory condition 2024-03-06 14:45:17 +00:00
stats.c nfsd: make svc_stat per-network namespace instead of global 2024-08-19 06:00:05 +02:00
stats.h nfsd: make svc_stat per-network namespace instead of global 2024-08-19 06:00:05 +02:00
trace.c
trace.h NFSD: Replace nfsd_prune_bucket() 2024-08-19 06:00:04 +02:00
vfs.c nfsd: map the EBADMSG to nfserr_io to avoid warning 2024-10-17 15:21:58 +02:00
vfs.h nfsd: move nfserrno() to vfs.c 2024-03-06 14:45:15 +00:00
xdr.h
xdr3.h
xdr4.h NFSD: Limit the number of concurrent async COPY operations 2024-11-22 15:37:32 +01:00
xdr4cb.h NFSD: add support for sending CB_RECALL_ANY 2024-03-06 14:45:17 +00:00