From owner-svn-src-head@FreeBSD.ORG Fri Feb 1 16:57:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D77E472A; Fri, 1 Feb 2013 16:57:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C706B1A8; Fri, 1 Feb 2013 16:57:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r11Gv2X7089084; Fri, 1 Feb 2013 16:57:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r11Gv2An089083; Fri, 1 Feb 2013 16:57:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302011657.r11Gv2An089083@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 1 Feb 2013 16:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246213 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 16:57:02 -0000 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