Skip to content

Commit febbc55

Browse files
committed
Merge tag 'nfsd-6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fixes from Chuck Lever: "Fixes for new bugs: - A fix for CB_GETATTR reply decoding was not quite correct - Fix the NFSD connection limiting logic - Fix a bug in the new session table resizing logic Bugs that pre-date v6.14: - Support for courteous clients (5.19) introduced a shutdown hang - Fix a crash in the filecache laundrette (6.9) - Fix a zero-day crash in NFSD's NFSv3 ACL implementation" * tag 'nfsd-6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: Fix CB_GETATTR status fix NFSD: fix hang in nfsd4_shutdown_callback nfsd: fix __fh_verify for localio nfsd: fix uninitialised slot info when a request is retried nfsd: validate the nfsd_serv pointer before calling svc_wake_up nfsd: clear acl_access/acl_default after releasing them
2 parents 58c9bf3 + 4990d09 commit febbc55

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed

fs/nfsd/filecache.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,20 @@ nfsd_file_dispose_list_delayed(struct list_head *dispose)
446446
struct nfsd_file, nf_gc);
447447
struct nfsd_net *nn = net_generic(nf->nf_net, nfsd_net_id);
448448
struct nfsd_fcache_disposal *l = nn->fcache_disposal;
449+
struct svc_serv *serv;
449450

450451
spin_lock(&l->lock);
451452
list_move_tail(&nf->nf_gc, &l->freeme);
452453
spin_unlock(&l->lock);
453-
svc_wake_up(nn->nfsd_serv);
454+
455+
/*
456+
* The filecache laundrette is shut down after the
457+
* nn->nfsd_serv pointer is cleared, but before the
458+
* svc_serv is freed.
459+
*/
460+
serv = nn->nfsd_serv;
461+
if (serv)
462+
svc_wake_up(serv);
454463
}
455464
}
456465

fs/nfsd/nfs2acl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ static __be32 nfsacld_proc_getacl(struct svc_rqst *rqstp)
8484
fail:
8585
posix_acl_release(resp->acl_access);
8686
posix_acl_release(resp->acl_default);
87+
resp->acl_access = NULL;
88+
resp->acl_default = NULL;
8789
goto out;
8890
}
8991

fs/nfsd/nfs3acl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ static __be32 nfsd3_proc_getacl(struct svc_rqst *rqstp)
7676
fail:
7777
posix_acl_release(resp->acl_access);
7878
posix_acl_release(resp->acl_default);
79+
resp->acl_access = NULL;
80+
resp->acl_default = NULL;
7981
goto out;
8082
}
8183

fs/nfsd/nfs4callback.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ static int nfs4_xdr_dec_cb_getattr(struct rpc_rqst *rqstp,
679679
return status;
680680

681681
status = decode_cb_op_status(xdr, OP_CB_GETATTR, &cb->cb_status);
682-
if (unlikely(status || cb->cb_seq_status))
682+
if (unlikely(status || cb->cb_status))
683683
return status;
684684
if (xdr_stream_decode_uint32_array(xdr, bitmap, 3) < 0)
685685
return -NFSERR_BAD_XDR;
@@ -1583,8 +1583,11 @@ nfsd4_run_cb_work(struct work_struct *work)
15831583
nfsd4_process_cb_update(cb);
15841584

15851585
clnt = clp->cl_cb_client;
1586-
if (!clnt) {
1587-
/* Callback channel broken, or client killed; give up: */
1586+
if (!clnt || clp->cl_state == NFSD4_COURTESY) {
1587+
/*
1588+
* Callback channel broken, client killed or
1589+
* nfs4_client in courtesy state; give up.
1590+
*/
15881591
nfsd41_destroy_cb(cb);
15891592
return;
15901593
}

fs/nfsd/nfs4state.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4459,10 +4459,11 @@ nfsd4_sequence(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
44594459
}
44604460
} while (slot && --cnt > 0);
44614461
}
4462+
4463+
out:
44624464
seq->maxslots = max(session->se_target_maxslots, seq->maxslots);
44634465
seq->target_maxslots = session->se_target_maxslots;
44644466

4465-
out:
44664467
switch (clp->cl_cb_state) {
44674468
case NFSD4_CB_DOWN:
44684469
seq->status_flags = SEQ4_STATUS_CB_PATH_DOWN;

fs/nfsd/nfsfh.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,9 @@ __fh_verify(struct svc_rqst *rqstp,
380380
error = check_nfsd_access(exp, rqstp, may_bypass_gss);
381381
if (error)
382382
goto out;
383-
384-
svc_xprt_set_valid(rqstp->rq_xprt);
383+
/* During LOCALIO call to fh_verify will be called with a NULL rqstp */
384+
if (rqstp)
385+
svc_xprt_set_valid(rqstp->rq_xprt);
385386

386387
/* Finally, check access permissions. */
387388
error = nfsd_permission(cred, exp, dentry, access);

0 commit comments

Comments
 (0)