Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39307655 authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

nfsd4: fix security flavor of NFSv4.0 callback



Commit d5497fc6 "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: default avatarJamie Heilman <jamie@audible.transient.net>
Reported-by: default avatarJamie Heilman <jamie@audible.transient.net>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent d9875690
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -651,12 +651,12 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c


	if (clp->cl_minorversion == 0) {
	if (clp->cl_minorversion == 0) {
		if (!clp->cl_cred.cr_principal &&
		if (!clp->cl_cred.cr_principal &&
				(clp->cl_flavor >= RPC_AUTH_GSS_KRB5))
				(clp->cl_cred.cr_flavor >= RPC_AUTH_GSS_KRB5))
			return -EINVAL;
			return -EINVAL;
		args.client_name = clp->cl_cred.cr_principal;
		args.client_name = clp->cl_cred.cr_principal;
		args.prognumber	= conn->cb_prog,
		args.prognumber	= conn->cb_prog,
		args.protocol = XPRT_TRANSPORT_TCP;
		args.protocol = XPRT_TRANSPORT_TCP;
		args.authflavor = clp->cl_flavor;
		args.authflavor = clp->cl_cred.cr_flavor;
		clp->cl_cb_ident = conn->cb_ident;
		clp->cl_cb_ident = conn->cb_ident;
	} else {
	} else {
		if (!conn->cb_xprt)
		if (!conn->cb_xprt)
+0 −1
Original line number Original line Diff line number Diff line
@@ -231,7 +231,6 @@ struct nfs4_client {
	nfs4_verifier		cl_verifier; 	/* generated by client */
	nfs4_verifier		cl_verifier; 	/* generated by client */
	time_t                  cl_time;        /* time of last lease renewal */
	time_t                  cl_time;        /* time of last lease renewal */
	struct sockaddr_storage	cl_addr; 	/* client ipaddress */
	struct sockaddr_storage	cl_addr; 	/* client ipaddress */
	u32			cl_flavor;	/* setclientid pseudoflavor */
	struct svc_cred		cl_cred; 	/* setclientid principal */
	struct svc_cred		cl_cred; 	/* setclientid principal */
	clientid_t		cl_clientid;	/* generated by server */
	clientid_t		cl_clientid;	/* generated by server */
	nfs4_verifier		cl_confirm;	/* generated by server */
	nfs4_verifier		cl_confirm;	/* generated by server */