WSL2-Linux-Kernel/fs/nfsd
Jeff Layton 8fcd461db7 nfsd: do nfs4_check_fh in nfs4_check_file instead of nfs4_check_olstateid
Currently, preprocess_stateid_op calls nfs4_check_olstateid which
verifies that the open stateid corresponds to the current filehandle in the
call by calling nfs4_check_fh.

If the stateid is a NFS4_DELEG_STID however, then no such check is done.
This could cause incorrect enforcement of permissions, because the
nfsd_permission() call in nfs4_check_file uses current the current
filehandle, but any subsequent IO operation will use the file descriptor
in the stateid.

Move the call to nfs4_check_fh into nfs4_check_file instead so that it
can be done for all stateid types.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Cc: stable@vger.kernel.org
[bfields: moved fh check to avoid NULL deref in special stateid case]
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2015-07-31 16:30:26 -04:00
..
Kconfig Merge branch 'for-4.1' of git://linux-nfs.org/~bfields/linux 2015-04-24 07:46:05 -07:00
Makefile
acl.h
auth.c
auth.h
blocklayout.c nfsd/blocklayout: pretend we can send deviceid notifications 2015-05-04 12:02:37 -04:00
blocklayoutxdr.c
blocklayoutxdr.h
cache.h
current_stateid.h
export.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
export.h
fault_inject.c
idmap.h
lockd.c
netns.h
nfs2acl.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfs3acl.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfs3proc.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfs3xdr.c nfsd: stop READDIRPLUS returning inconsistent attributes 2015-05-07 11:47:00 -04:00
nfs4acl.c nfsd: use swap() in sort_pacl_range() 2015-06-19 15:39:50 -04:00
nfs4callback.c nfsd: Update callback sequnce id only CB_SEQUENCE success 2015-06-04 16:51:30 -04:00
nfs4idmap.c
nfs4layouts.c nfsd: Fix a file leak on nfsd4_layout_setlease failure 2015-07-20 14:58:22 -04:00
nfs4proc.c nfsd: fput rd_file from XDR encode context 2015-06-22 14:15:04 -04:00
nfs4recover.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfs4state.c nfsd: do nfs4_check_fh in nfs4_check_file instead of nfs4_check_olstateid 2015-07-31 16:30:26 -04:00
nfs4xdr.c nfsd: Drop BUG_ON and ignore SECLABEL on absent filesystem 2015-07-20 14:58:22 -04:00
nfscache.c
nfsctl.c nfsd: fix nsfd startup race triggering BUG_ON 2015-04-21 16:16:03 -04:00
nfsd.h nfsd: eliminate NFSD_DEBUG 2015-04-21 16:16:02 -04:00
nfsfh.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfsfh.h VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
nfsproc.c nfsd: Disable NFSv2 timestamp workaround for NFSv3+ 2015-05-29 11:04:01 -04:00
nfssvc.c
nfsxdr.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
pnfs.h
state.h nfsd: take struct file setup fully into nfs4_preprocess_stateid_op 2015-06-22 14:15:03 -04:00
stats.c
stats.h
trace.c
trace.h
vfs.c nfsd: take struct file setup fully into nfs4_preprocess_stateid_op 2015-06-22 14:15:03 -04:00
vfs.h nfsd: take struct file setup fully into nfs4_preprocess_stateid_op 2015-06-22 14:15:03 -04:00
xdr.h
xdr3.h
xdr4.h nfsd: take struct file setup fully into nfs4_preprocess_stateid_op 2015-06-22 14:15:03 -04:00
xdr4cb.h