Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Aug 2015 22:02:15 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286790 - head/sys/fs/nfsserver
Message-ID:  <201508142202.t7EM2FZS090206@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Fri Aug 14 22:02:14 2015
New Revision: 286790
URL: https://svnweb.freebsd.org/changeset/base/286790

Log:
  For the case where an NFSv4.1 ExchangeID operation has the client identifier
  that already has a confirmed ClientID, the nfsrv_setclient() function would
  not fill in the clientidp being returned. As such, the value of ClientID
  returned would be whatever garbage was on the stack.
  An NFSv4.1 client would not normally do this, but it appears that it can
  happen for certain Linux clients. When it happens, the client persistently
  retries the ExchangeID and Create_session after Create_session fails when
  it uses the bogus clientid. With this patch, the correct clientid is replied.
  This problem was identified in a packet trace supplied by
  Ahmed Kamal via email.
  
  Reported by:	email.ahmedkamal@googlemail.com
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdstate.c

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdstate.c	Fri Aug 14 21:44:42 2015	(r286789)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c	Fri Aug 14 22:02:14 2015	(r286790)
@@ -401,9 +401,12 @@ nfsrv_setclient(struct nfsrv_descript *n
 	}
 
 	/* For NFSv4.1, mark that we found a confirmed clientid. */
-	if ((nd->nd_flag & ND_NFSV41) != 0)
+	if ((nd->nd_flag & ND_NFSV41) != 0) {
+		clientidp->lval[0] = clp->lc_clientid.lval[0];
+		clientidp->lval[1] = clp->lc_clientid.lval[1];
+		confirmp->lval[0] = 0;	/* Ignored by client */
 		confirmp->lval[1] = 1;
-	else {
+	} else {
 		/*
 		 * id and verifier match, so update the net address info
 		 * and get rid of any existing callback authentication



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508142202.t7EM2FZS090206>