Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2012 00:51:05 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r229451 - stable/7/sys/nfsclient
Message-ID:  <201201040051.q040p5Hc052029@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Wed Jan  4 00:51:05 2012
New Revision: 229451
URL: http://svn.freebsd.org/changeset/base/229451

Log:
  MFC: r227690
  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.
  This is not exactly a merge, since the code is in sys/nfsclient/nfs_socket.c,
  which does not exist in head.
  
  Tested by:	martin at lispworks.com
  PR:		kern/153847

Modified:
  stable/7/sys/nfsclient/nfs_socket.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/nfsclient/nfs_socket.c
==============================================================================
--- stable/7/sys/nfsclient/nfs_socket.c	Wed Jan  4 00:24:09 2012	(r229450)
+++ stable/7/sys/nfsclient/nfs_socket.c	Wed Jan  4 00:51:05 2012	(r229451)
@@ -1351,6 +1351,12 @@ wait_for_pinned_req:
 				rep->r_xid = *xidp = txdr_unsigned(nfs_xid_gen());
 				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



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