linux-yocto/fs/nfsd
Li Lingfeng 0fccf5f01e 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:05:23 +01:00
..
acl.h NFSD: add posix ACLs to struct nfsd_attrs 2024-04-10 16:19:14 +02:00
auth.c
auth.h
blocklayout.c nfsd: move nfserrno() to vfs.c 2024-04-10 16:19:21 +02:00
blocklayoutxdr.c nfsd: move nfserrno() to vfs.c 2024-04-10 16:19:21 +02:00
blocklayoutxdr.h
cache.h nfsd: make all of the nfsd stats per-network namespace 2024-09-04 13:23:31 +02:00
current_stateid.h
export.c nfsd: make sure exp active before svc_export_show 2024-12-14 19:51:24 +01:00
export.h NFSD: Fix frame size warning in svc_export_parse() 2024-09-04 13:23:29 +02:00
fault_inject.c
filecache.c nfsd: add list_head nf_gc to struct nfsd_file 2025-01-23 17:16:03 +01:00
filecache.h nfsd: add list_head nf_gc to struct nfsd_file 2025-01-23 17:16:03 +01:00
flexfilelayout.c nfsd: move nfserrno() to vfs.c 2024-04-10 16:19:21 +02:00
flexfilelayoutxdr.c
flexfilelayoutxdr.h
idmap.h
Kconfig nfs: add missing selections of CONFIG_CRC32 2025-05-02 07:44:12 +02:00
lockd.c
Makefile nfsd: allow disabling NFSv2 at compile time 2024-04-10 16:19:21 +02:00
netns.h NFSD: Limit the number of concurrent async COPY operations 2024-12-14 19:50:37 +01:00
nfs2acl.c nfsd: clear acl_access/acl_default after releasing them 2025-03-13 12:50:34 +01:00
nfs3acl.c nfsd: clear acl_access/acl_default after releasing them 2025-03-13 12:50:34 +01:00
nfs3proc.c NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection 2024-04-10 16:19:22 +02:00
nfs3xdr.c NFSD: Clean up WRITE arg decoders 2024-04-10 16:19:18 +02:00
nfs4acl.c NFSD: add posix ACLs to struct nfsd_attrs 2024-04-10 16:19:14 +02:00
nfs4callback.c NFSD: fix hang in nfsd4_shutdown_callback 2025-03-13 12:50:34 +01:00
nfs4idmap.c nfsd: call cache_put if xdr_reserve_space returns NULL 2024-10-17 15:11:04 +02:00
nfs4layouts.c NFSD: Add tracepoints to report NFSv4 callback completions 2024-04-10 16:19:16 +02:00
nfs4proc.c nfsd: nfsd4_spo_must_allow() must check this is a v4 compound request 2025-06-27 11:05:23 +01:00
nfs4recover.c NFSD: Cap the number of bytes copied by nfs4_reset_recoverydir() 2024-12-14 19:51:07 +01:00
nfs4state.c nfsd: decrease sc_count directly if fail to queue dl_recall 2025-05-02 07:44:12 +02:00
nfs4xdr.c NFSD: Fix NFSv4's PUTPUBFH operation 2024-10-17 15:11:39 +02:00
nfscache.c nfsd: make all of the nfsd stats per-network namespace 2024-09-04 13:23:31 +02:00
nfsctl.c nfsd: make svc_stat per-network namespace instead of global 2024-09-04 13:23:31 +02:00
nfsd.h nfsd: remove nfsd_stats, make th_cnt a global counter 2024-09-04 13:23:31 +02:00
nfsfh.c nfsd: make all of the nfsd stats per-network namespace 2024-09-04 13:23:31 +02:00
nfsfh.h nfs: add missing selections of CONFIG_CRC32 2025-05-02 07:44:12 +02:00
nfsproc.c NFSD: Use set_bit(RQ_DROPME) 2024-04-10 16:19:25 +02:00
nfssvc.c nfsd: Initialize ssc before laundromat_work to prevent NULL dereference 2025-06-27 11:05:23 +01:00
nfsxdr.c NFSD: Clean up WRITE arg decoders 2024-04-10 16:19:18 +02:00
pnfs.h
state.h NFSD: add delegation reaper to react to low memory condition 2024-04-10 16:19:24 +02:00
stats.c nfsd: make svc_stat per-network namespace instead of global 2024-09-04 13:23:31 +02:00
stats.h nfsd: make svc_stat per-network namespace instead of global 2024-09-04 13:23:31 +02:00
trace.c
trace.h NFSD: Replace nfsd_prune_bucket() 2024-09-04 13:23:29 +02:00
vfs.c nfsd: map the EBADMSG to nfserr_io to avoid warning 2024-10-17 15:11:39 +02:00
vfs.h NFSD: Pass the target nfsd_file to nfsd_commit() 2024-04-10 16:19:21 +02:00
xdr.h
xdr3.h
xdr4.h NFSD: Limit the number of concurrent async COPY operations 2024-12-14 19:50:37 +01:00
xdr4cb.h NFSD: add support for sending CB_RECALL_ANY 2024-04-10 16:19:24 +02:00