More mbuf INVARIANTS code, comments needed

Vincent Jardin vjardin at wanadoo.fr
Fri May 2 00:46:30 PDT 2003


It is a good idea. I do not see any problems with your patch.

An esthetic comment:
I would prefer to see other trivial hexadecimal values like:
  - 0xd0 (as in "Duh", used by stdlib/malloc())
  - or 0xdeadc0de (used by kern_malloc.c:#define WEIRD_ADDR  0xdeadc0de)
  - or 0xdead0137, 0xdead0138, 0xdead0139, ...

According to me, these values are easier to analyse when you get a panic or 
when you dump the memory.

Regards,
  Vincent

On Friday 02 May 2003 08:08, Mike Silbersack wrote:
> Now that I have the double-free code in (under INVARIANTS), I'm
> considering the attached patch as well; it fills the m_data, m_next, and
> m_nextpkt fields with non-NULL garbage in hopes that any uses after free
> will be immediately fatal.
>
> Does anyone see problems with this, and/or other simple checks that could
> be added cheaply?
>
> Thanks,
>
> Mike "Silby" Silbersack


More information about the freebsd-net mailing list