Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2013 16:57:02 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r246213 - head/sys/fs/nfs
Message-ID:  <201302011657.r11Gv2An089083@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Feb  1 16:57:02 2013
New Revision: 246213
URL: http://svnweb.freebsd.org/changeset/base/246213

Log:
  Assert that the mbuf in the chain has sane length.  Proper place for
  this check is somewhere in the network code, but this assertion
  already proven to be useful in catching what seems to be driver bugs
  causing NFS scrambling random memory.
  
  Discussed with:	rmacklem
  MFC after:	1 week

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonsubs.c	Fri Feb  1 16:48:55 2013	(r246212)
+++ head/sys/fs/nfs/nfs_commonsubs.c	Fri Feb  1 16:57:02 2013	(r246213)
@@ -218,6 +218,7 @@ nfsm_mbufuio(struct nfsrv_descript *nd, 
 				}
 				mbufcp = NFSMTOD(mp, caddr_t);
 				len = mbuf_len(mp);
+				KASSERT(len > 0, ("len %d", len));
 			}
 			xfer = (left > len) ? len : left;
 #ifdef notdef



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