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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to