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

Commit 19311aa8 authored by Kinglong Mee's avatar Kinglong Mee Committed by J. Bruce Fields
Browse files

nfsd: New counter for generating client confirm verifier



If using clientid_counter, it seems possible that gen_confirm could
generate the same verifier for the same client in some situations.

Add a new counter for client confirm verifier to make sure gen_confirm
generates a different verifier on each call for the same clientid.

Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Reviewed-by: default avatarJeff Layton <jlayton@poochiereds.net>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent d50ffded
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ struct nfsd_net {
	unsigned int max_connections;

	u32 clientid_counter;
	u32 clverifier_counter;

	struct svc_serv *nfsd_serv;
};
+1 −1
Original line number Diff line number Diff line
@@ -1899,7 +1899,7 @@ static void gen_confirm(struct nfs4_client *clp, struct nfsd_net *nn)
	 * __force to keep sparse happy
	 */
	verf[0] = (__force __be32)get_seconds();
	verf[1] = (__force __be32)nn->clientid_counter;
	verf[1] = (__force __be32)nn->clverifier_counter++;
	memcpy(clp->cl_confirm.data, verf, sizeof(clp->cl_confirm.data));
}