Skip to content

Commit b61778f

Browse files
committed
Merge tag 'nfsd-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fixes from Chuck Lever: - Fix a filecache UAF during NFSD shutdown - Avoid exposing automounted mounts on NFS re-exports * tag 'nfsd-6.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: fix handling of readdir in v4root vs. mount upcall timeout nfsd: shut down the NFSv4 state objects before the filecache
2 parents 69b41ac + cad8533 commit b61778f

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

fs/nfsd/nfs4xdr.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3629,6 +3629,17 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
36293629
case nfserr_noent:
36303630
xdr_truncate_encode(xdr, start_offset);
36313631
goto skip_entry;
3632+
case nfserr_jukebox:
3633+
/*
3634+
* The pseudoroot should only display dentries that lead to
3635+
* exports. If we get EJUKEBOX here, then we can't tell whether
3636+
* this entry should be included. Just fail the whole READDIR
3637+
* with NFS4ERR_DELAY in that case, and hope that the situation
3638+
* will resolve itself by the client's next attempt.
3639+
*/
3640+
if (cd->rd_fhp->fh_export->ex_flags & NFSEXP_V4ROOT)
3641+
goto fail;
3642+
fallthrough;
36323643
default:
36333644
/*
36343645
* If the client requested the RDATTR_ERROR attribute,

fs/nfsd/nfssvc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ static void nfsd_shutdown_net(struct net *net)
453453
{
454454
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
455455

456-
nfsd_file_cache_shutdown_net(net);
457456
nfs4_state_shutdown_net(net);
457+
nfsd_file_cache_shutdown_net(net);
458458
if (nn->lockd_up) {
459459
lockd_down(net);
460460
nn->lockd_up = false;

0 commit comments

Comments
 (0)