linux-stable/fs/nfsd
J. Bruce Fields 0f60f9d1e6 nfsd4: readdirplus shouldn't return parent of export
commit 51b2ee7d00 upstream.

If you export a subdirectory of a filesystem, a READDIRPLUS on the root
of that export will return the filehandle of the parent with the ".."
entry.

The filehandle is optional, so let's just not return the filehandle for
".." if we're at the root of an export.

Note that once the client learns one filehandle outside of the export,
they can trivially access the rest of the export using further lookups.

However, it is also not very difficult to guess filehandles outside of
the export.  So exporting a subdirectory of a filesystem should
considered equivalent to providing access to the entire filesystem.  To
avoid confusion, we recommend only exporting entire filesystems.

Reported-by: Youjipeng <wangzhibei1999@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-23 15:48:45 +01:00
..
acl.h
auth.c
auth.h
blocklayout.c
blocklayoutxdr.c
blocklayoutxdr.h
cache.h
current_stateid.h
export.c
export.h
fault_inject.c
flexfilelayout.c
flexfilelayoutxdr.c
flexfilelayoutxdr.h
idmap.h
Kconfig
lockd.c
Makefile
netns.h
nfs2acl.c
nfs3acl.c
nfs3proc.c nfsd: fix memory corruption caused by readdir 2019-03-23 14:35:28 +01:00
nfs3xdr.c nfsd4: readdirplus shouldn't return parent of export 2021-01-23 15:48:45 +01:00
nfs4acl.c
nfs4callback.c nfsd: Fix svc_xprt refcnt leak when setup callback client failed 2020-06-25 15:41:49 +02:00
nfs4idmap.c
nfs4layouts.c nfsd: fix delay timer on 32-bit architectures 2020-02-14 16:32:17 -05:00
nfs4proc.c nfsd: COPY and CLONE operations require the saved filehandle to be set 2018-11-21 09:24:14 +01:00
nfs4recover.c nfsd: fix a warning in __cld_pipe_upcall() 2019-12-17 20:38:18 +01:00
nfs4state.c nfsd: memory corruption in nfsd4_lock() 2020-05-02 17:24:41 +02:00
nfs4xdr.c nfsd: fix potential use-after-free in nfsd4_decode_getdeviceinfo 2018-08-03 07:50:22 +02:00
nfscache.c
nfsctl.c nfsd: fix wrong check in write_v4_end_grace() 2019-03-23 14:35:28 +01:00
nfsd.h
nfsfh.c
nfsfh.h
nfsproc.c NFSD: Add missing NFSv2 .pc_func methods 2020-11-05 11:07:02 +01:00
nfssvc.c nfsd: Fix message level for normal termination 2020-12-29 13:47:00 +01:00
nfsxdr.c
pnfs.h
state.h nfsd: fix jiffies/time_t mixup in LRU list 2020-02-14 16:32:17 -05:00
stats.c
stats.h
trace.c
trace.h
vfs.c nfsd: apply umask on fs without ACL support 2020-07-09 09:36:31 +02:00
vfs.h nfsd: allow fh_want_write to be called twice 2019-06-15 11:54:54 +02:00
xdr.h
xdr3.h
xdr4.h nfsd4: fix cached replies to solo SEQUENCE compounds 2019-02-12 19:46:14 +01:00
xdr4cb.h