----- Original Message -----
From: "Lennert Buytenhek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, December 09, 2001 9:43 AM
Subject: Re: [Bridge] Bridge bug? accepts multicast packets on blocking
ports?


> And even after this patch, we have the problem that we pass packets to the
> PRE_ROUTING hook that come from ports that are not in the FORWARDING
state.
> Bart, could you quickly eyeball 05_all_at_once.diff from the patchtracker
> (http://bridge.sourceforge.net/patchtracker.html) for sanity?  The diff
> looks somewhat confusing so it's probably better to apply it somewhere
> first.
>

I had a look at the code. All looks logical, and better readable than the
old code.
But I think there is still a race condition in it on an smp box. I'm not
sure if you know about this, so here it goes:

cpu0:
net/bridge/br_input.c:br_handle_frame_finish()
1. skb->dev->br_port is read without the read_lock.
2. interrupt follows
cpu1:(user context)
net/bridge/br_if.c:br_del_if()
3. under the write_lock the port is removed (kfree()).
cpu0:
4. end of interrupt
p is a dangling pointer.

To solve this I think we need a spinlock in the net_device struct.
Or did I miss something?

cheers,
Bart

_______________________________________________
Bridge mailing list
[EMAIL PROTECTED]
http://www.math.leidenuniv.nl/mailman/listinfo/bridge

Reply via email to