1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-27 08:00:11 +00:00

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
This commit is contained in:
Konstantin Belousov 2013-02-01 16:57:02 +00:00
parent e7f1427dd2
commit dd6035234a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=246213

View File

@ -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