Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Jul 1995 00:52:48 -0700
From:      David Greenman <davidg@Root.COM>
To:        Mike Pritchard <mpp@legarto.minn.net>
Cc:        fenner@parc.xerox.com (Bill Fenner), bugs@freebsd.org
Subject:   Re: ipfw 'reject' panics the system 
Message-ID:  <199507060752.AAA02233@corbin.Root.COM>
In-Reply-To: Your message of "Thu, 06 Jul 95 02:28:30 CDT." <199507060728.CAA03114@mpp.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>> I took a glance at the firewall stuff when Michael Butler posted his most
>> recent message saying that using the firewall reject code will panic the
>> machine when a rejected packet comes in.  It turns out that the firewall
>> code uses dtom(ip) on a rejected packet, but it's entirely possible that
>> the packet is in a cluster mbuf, on which dtom() doesn't work.  I fixed
>> the code to pass the original mbuf along with the ip pointer, and Michael
>> said his panics went away.
>> 
>> Can someone (review and) commit these diffs?
>> 
>> Thanks,
>> 
>>   Bill
>>
>>...patches deleted...
...
>After a quick look, it seems like dtom() should do the right thing,
>since the ipfw code is passed a pointer from mtod(), which should
>be the reverse of dtom().  If it isn't, then we probably have bigger 
>things to worry about.  

   Bill is correct; dtom() can't convert the address of an mbuf cluster. The
address the mtod() returns is simply the beginning of a 2k chunk of memory and
has no "mbuf" structure. Trying to free such a thing would have quite
undesirable effects.

>If we have problems with freeing individual mbufs that are part
>of mbuf clusters, then I would expect to see out of memory problems/many
>more problems.  Again, this may be the case, but on my setup is isn't.  

   Not really. The ipfw code is doing something that shouldn't be done, and
that is that it tries to free an mbuf whose pointer was gotten from some funky
dtom(mtod()) equivilent. Other code in the kernel doesn't do this. The correct
solution is to pass the mbuf pointer around and never use dtom().

   I didn't see Bill's original message+diffs...Would you send me a copy, Bill?

-DG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507060752.AAA02233>