ip_reass() - possibly incorrect goto
silby at silby.com
Thu Mar 24 02:46:18 PST 2005
On Wed, 23 Mar 2005, Maxim Konovalov wrote:
> On Tue, 22 Mar 2005, 12:08-0800, Vijay.Singh at nokia.com wrote:
>> Hi hackers, I am looking at the ip_reass() routine. In case of the
>> 1st fragment we create the reassembly queue. After the queue has
>> been inserted in the hash bucket, the if () code does a " goto
>> inserted". Should this be changed to "goto done" instead? Any code
>> that is executed for the 1st fragment, like frag per packet limiting
>> and complete reassembly are not valid. Am I mistaken?
> Yep, it seems you are right. The second micro optimization - drop the
> fragment early if maxfragsperpacket == 0.
> Andre, Mike, what do you think?
Looks good to me. Please tell us if you come up with any more
optimizations for the reassembly code, Vijay.
On a related note...
While looking through the code, I think I figured out a way to avoid IDSes
if you're trying to mess with a FreeBSD machine:
* Handle ECN by comparing this segment with the first one;
* if CE is set, do not lose CE.
* drop if CE and not-ECT are mixed for the same packet.
Couldn't you send a fragment with half the "exploit" payload (too short
for the IDS to match), then send a packet with a different ECN status to
overwrite that fragment (at least in the IDS's buffer, but not in
FreeBSD's, since it would be dropped), and then send the second part of
Mike "Silby" Silbersack
More information about the freebsd-hackers