Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Nov 2011 03:20: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: r227690 - head/sys/nfsclient
Message-ID:  <201111190320.pAJ3KFE4017843@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sat Nov 19 03:20:15 2011
New Revision: 227690
URL: http://svn.freebsd.org/changeset/base/227690

Log:
  The old NFS client will crash due to the reply being m_freem()'d
  twice if the server bogusly returns an error with the NFSERR_RETERR
  bit (bit 31) set. No actual NFS error has this bit set, but it seems
  that amd will sometimes do this. This patch makes sure the NFSERR_RETERR
  bit is cleared to avoid a crash.
  
  PR:		kern/153847
  MFC after:	2 weeks

Modified:
  head/sys/nfsclient/nfs_krpc.c

Modified: head/sys/nfsclient/nfs_krpc.c
==============================================================================
--- head/sys/nfsclient/nfs_krpc.c	Sat Nov 19 00:20:28 2011	(r227689)
+++ head/sys/nfsclient/nfs_krpc.c	Sat Nov 19 03:20:15 2011	(r227690)
@@ -540,6 +540,11 @@ tryagain:
 				    hz);
 			goto tryagain;
 		}
+		/*
+		 * Make sure NFSERR_RETERR isn't bogusly set by a server
+		 * such as amd. (No actual NFS error has bit 31 set.)
+		 */
+		error &= ~NFSERR_RETERR;
 
 		/*
 		 * If the File Handle was stale, invalidate the lookup



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