Commit 39307655a1effa8d913bba054c0e985bfaca808c
1 parent
d9875690d9
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
nfsd4: fix security flavor of NFSv4.0 callback
Commit d5497fc693a446ce9100fcf4117c3f795ddfd0d2 "nfsd4: move rq_flavor into svc_cred" forgot to remove cl_flavor from the client, leaving two places (cl_flavor and cl_cred.cr_flavor) for the flavor to be stored. After that patch, the latter was the one that was updated, but the former was the one that the callback used. Symptoms were a long delay on utime(). This is because the utime() generated a setattr which recalled a delegation, but the cb_recall was ignored by the client because it had the wrong security flavor. Cc: stable@vger.kernel.org Tested-by: Jamie Heilman <jamie@audible.transient.net> Reported-by: Jamie Heilman <jamie@audible.transient.net> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Showing 2 changed files with 2 additions and 3 deletions Side-by-side Diff
fs/nfsd/nfs4callback.c
... | ... | @@ -651,12 +651,12 @@ |
651 | 651 | |
652 | 652 | if (clp->cl_minorversion == 0) { |
653 | 653 | if (!clp->cl_cred.cr_principal && |
654 | - (clp->cl_flavor >= RPC_AUTH_GSS_KRB5)) | |
654 | + (clp->cl_cred.cr_flavor >= RPC_AUTH_GSS_KRB5)) | |
655 | 655 | return -EINVAL; |
656 | 656 | args.client_name = clp->cl_cred.cr_principal; |
657 | 657 | args.prognumber = conn->cb_prog, |
658 | 658 | args.protocol = XPRT_TRANSPORT_TCP; |
659 | - args.authflavor = clp->cl_flavor; | |
659 | + args.authflavor = clp->cl_cred.cr_flavor; | |
660 | 660 | clp->cl_cb_ident = conn->cb_ident; |
661 | 661 | } else { |
662 | 662 | if (!conn->cb_xprt) |
fs/nfsd/state.h
... | ... | @@ -231,7 +231,6 @@ |
231 | 231 | nfs4_verifier cl_verifier; /* generated by client */ |
232 | 232 | time_t cl_time; /* time of last lease renewal */ |
233 | 233 | struct sockaddr_storage cl_addr; /* client ipaddress */ |
234 | - u32 cl_flavor; /* setclientid pseudoflavor */ | |
235 | 234 | struct svc_cred cl_cred; /* setclientid principal */ |
236 | 235 | clientid_t cl_clientid; /* generated by server */ |
237 | 236 | nfs4_verifier cl_confirm; /* generated by server */ |