diff options
author | kib <kib@FreeBSD.org> | 2013-02-01 16:57:02 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-02-01 16:57:02 +0000 |
commit | 5012e4bd24ba7188c76c8a4967032bb087a6caca (patch) | |
tree | cb3f7e57a525aaa356cb302e98261894ec59987f /sys/fs/nfs | |
parent | 5c708a87b105b5ed98582031452348132c5a02e8 (diff) | |
download | FreeBSD-src-5012e4bd24ba7188c76c8a4967032bb087a6caca.zip FreeBSD-src-5012e4bd24ba7188c76c8a4967032bb087a6caca.tar.gz |
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
Diffstat (limited to 'sys/fs/nfs')
-rw-r--r-- | sys/fs/nfs/nfs_commonsubs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index efc0786..b2d74c7 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -218,6 +218,7 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio *uiop, int siz) } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); + KASSERT(len > 0, ("len %d", len)); } xfer = (left > len) ? len : left; #ifdef notdef |