WSL2-Linux-Kernel/fs/nfsd
J. Bruce Fields 4425ca3677 nfsd: fix crash on COPY_NOTIFY with special stateid
[ Upstream commit 074b07d94e ]

RTM says "If the special ONE stateid is passed to
nfs4_preprocess_stateid_op(), it returns status=0 but does not set
*cstid. nfsd4_copy_notify() depends on stid being set if status=0, and
thus can crash if the client sends the right COPY_NOTIFY RPC."

RFC 7862 says "The cna_src_stateid MUST refer to either open or locking
states provided earlier by the server.  If it is invalid, then the
operation MUST fail."

The RFC doesn't specify an error, and the choice doesn't matter much as
this is clearly illegal client behavior, but bad_stateid seems
reasonable.

Simplest is just to guarantee that nfs4_preprocess_stateid_op, called
with non-NULL cstid, errors out if it can't return a stateid.

Reported-by: rtm@csail.mit.edu
Fixes: 624322f1ad ("NFSD add COPY_NOTIFY operation")
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Olga Kornievskaia <kolga@netapp.com>
Tested-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-03-08 19:12:36 +01:00
..
Kconfig
Makefile
acl.h
auth.c
auth.h
blocklayout.c
blocklayoutxdr.c
blocklayoutxdr.h
cache.h
current_stateid.h
export.c
export.h
fault_inject.c
filecache.c nfsd: Fix a warning for nfsd_file_close_inode 2021-10-01 11:17:40 -04:00
filecache.h
flexfilelayout.c
flexfilelayoutxdr.c
flexfilelayoutxdr.h
idmap.h
lockd.c
netns.h
nfs2acl.c
nfs3acl.c
nfs3proc.c NFSD: Fix zero-length NFSv3 WRITEs 2022-03-08 19:12:33 +01:00
nfs3xdr.c Revert "nfsd: skip some unnecessary stats in the v4 case" 2022-03-08 19:12:36 +01:00
nfs4acl.c
nfs4callback.c
nfs4idmap.c
nfs4layouts.c
nfs4proc.c NFSD: Have legacy NFSD WRITE decoders use xdr_stream_subsegment() 2022-03-08 19:12:33 +01:00
nfs4recover.c nfsd: Fix nsfd startup race (again) 2021-12-14 10:57:14 +01:00
nfs4state.c nfsd: fix crash on COPY_NOTIFY with special stateid 2022-03-08 19:12:36 +01:00
nfs4xdr.c NFSD: Fix the behavior of READ near OFFSET_MAX 2022-02-16 12:56:06 +01:00
nfscache.c
nfsctl.c fsnotify: fix fsnotify hooks in pseudo filesystems 2022-02-01 17:27:01 +01:00
nfsd.h
nfsfh.c
nfsfh.h
nfsproc.c NFSD: Fix zero-length NFSv3 WRITEs 2022-03-08 19:12:33 +01:00
nfssvc.c
nfsxdr.c NFSD: Have legacy NFSD WRITE decoders use xdr_stream_subsegment() 2022-03-08 19:12:33 +01:00
pnfs.h
state.h
stats.c
stats.h
trace.c
trace.h NFSD: Fix offset type in I/O trace points 2022-02-16 12:56:06 +01:00
vfs.c NFSD: Fix verifier returned in stable WRITEs 2022-03-08 19:12:36 +01:00
vfs.h
xdr.h NFSD: Have legacy NFSD WRITE decoders use xdr_stream_subsegment() 2022-03-08 19:12:33 +01:00
xdr3.h NFSD: Have legacy NFSD WRITE decoders use xdr_stream_subsegment() 2022-03-08 19:12:33 +01:00
xdr4.h
xdr4cb.h