Review needed: Mbuf double-free detection patch

Archie Cobbs archie at dellroad.org
Wed Apr 30 17:00:07 PDT 2003


Mike Silbersack wrote:
> I'd be interested in comments on the attached patch from anyone who's been
> doing work with network drivers & such.  All it does is add a M_FREELIST
> flag which is set whenever a mbuf is freed.  If m_free or m_freem find
> this flag to be set, they will panic, as this is a clear sign that the
> mbuf was freed twice.  (All flags are cleared whenever a mbuf is
> taken off the freelist, so false M_FREELIST hits shouldn't occur.)

Without reviewing the patch, I like the idea a whole lot. We added
similar sanity checks at Vernier and they were very helpful.

-Archie

__________________________________________________________________________
Archie Cobbs     *     Precision I/O      *     http://www.precisionio.com


More information about the freebsd-net mailing list