From a7b844d2beda5d51bf830c08e2fea8a8351d3724 Mon Sep 17 00:00:00 2001 From: Mike Silbersack Date: Wed, 29 Jun 2005 08:18:26 +0000 Subject: [PATCH] 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) --- sys/kern/kern_mbuf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index b83c32742f15..b6b75c1aa3f1 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 } /*