diff options
author | silby <silby@FreeBSD.org> | 2005-06-29 08:18:26 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2005-06-29 08:18:26 +0000 |
commit | 0edd2a4f6f00b1528ebec4e54b9a0fdcb4a64ddd (patch) | |
tree | 6c825d8a87fb3fe79d721a9157d5389eceed0c1f /sys | |
parent | bd7fc02cf00f7446a4fc2151d3367d5e935dacae (diff) | |
download | FreeBSD-src-0edd2a4f6f00b1528ebec4e54b9a0fdcb4a64ddd.zip FreeBSD-src-0edd2a4f6f00b1528ebec4e54b9a0fdcb4a64ddd.tar.gz |
Fix the false memory modified after free messages some users have been
reporting - in my previous change, I missed the case where a mbuf
from the packet zone was freed back to the mbuf/packet keg, where
it was subsequently put into the mbuf zone and found not to contain
the expected trash. This change adds the necessary trash_dtor call inside
mb_fini_pack so that everything is correct.
Thanks for Bosko for finding the bug and showing me how secondary zones
work.
Approved by: re (dwhite)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_mbuf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index b83c327..b6b75c1 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -336,6 +336,9 @@ mb_fini_pack(void *mem, int size) uma_zfree_arg(zone_clust, m->m_ext.ext_buf, NULL); m->m_ext.ext_buf = NULL; mbstat.m_mclusts += 1; /* XXX */ +#ifdef INVARIANTS + trash_dtor(mem, size, NULL); +#endif } /* |