Date: Sun, 28 Dec 2014 07:14:39 +0000 (UTC) From: Peter Jeremy <peterj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276327 - stable/10/sys/fs/nfs Message-ID: <201412280714.sBS7Edcc084865@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: peterj Date: Sun Dec 28 07:14:38 2014 New Revision: 276327 URL: https://svnweb.freebsd.org/changeset/base/276327 Log: MFH r275941: Adjust the test of a KASSERT to better match the intent. This assertion was added in r246213 as a guard against corrupted mbufs arriving from drivers, the key distinguishing factor of said mbufs being that they had a negative length. Given we're in a while loop specifically designed to skip over zero-length mbufs, panicking on a zero-length mbuf seems incorrect. Suggested by: rmacklem MFH go-ahead: benno Approved by: grog (co-mentor) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Sun Dec 28 06:41:13 2014 (r276326) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Sun Dec 28 07:14:38 2014 (r276327) @@ -219,7 +219,8 @@ nfsm_mbufuio(struct nfsrv_descript *nd, } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); - KASSERT(len > 0, ("len %d", len)); + KASSERT(len >= 0, + ("len %d, corrupted mbuf?", 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?201412280714.sBS7Edcc084865>