lentferj's projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
45e1f3c
)
network - Assert that the packet's data has not overrrun the buffer in m_free()
author
Matthew Dillon <dillon@apollo.backplane.com>
Sun, 12 Sep 2010 04:35:14 +0000 (21:35 -0700)
committer
Matthew Dillon <dillon@laptop2.(none)>
Sun, 12 Sep 2010 04:35:14 +0000 (21:35 -0700)
* Add an assertion to try to catch subsystems which blow up a mbuf's
data buffer.
sys/kern/uipc_mbuf.c
patch
|
blob
|
blame
|
history
diff --git
a/sys/kern/uipc_mbuf.c
b/sys/kern/uipc_mbuf.c
index
75120a2
..
b0bb3f1
100644
(file)
--- a/
sys/kern/uipc_mbuf.c
+++ b/
sys/kern/uipc_mbuf.c
@@
-922,6
+922,7
@@
m_free(struct mbuf *m)
struct globaldata *gd = mycpu;
KASSERT(m->m_type != MT_FREE, ("freeing free mbuf %p", m));
+ KASSERT(M_TRAILINGSPACE(m) >= 0, ("overflowed mbuf %p", m));
atomic_subtract_long_nonlocked(&mbtypes[gd->gd_cpuid][m->m_type], 1);
n = m->m_next;