Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
- From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 11 Apr 2009 11:57:16 -0700 (PDT)
On Fri, 10 Apr 2009, Paul E. McKenney wrote:
1. Assuming that the synchronize_net() is intended to guarantee
that the new rules will be in effect before returning to
user space:
Btw, I think that's a bad assumption.
The thing is, nobody can really care if the new rules are in effect or
not, because the thing you race with is not the "return to user space"
part, but the incoming packets.
And those incoming packets might have been incoming before the rules were
set up too.
So I seriously doubt you need to synchronize with any returning to user
space. What you want to synchronize with is then later actions that do
things like turning on the interface that the rules are attached to etc!
So I would suggest:
- remove the synchronize_net() entirely. Replace it with just freeing the
old rules using RCU.
- new packets will always end up seeing the new rules. That includes the
case of somebody doing "ifconfig eth0 up" that enables a new source of
packets, so there are no real security issues.
- if you enabled your network interfaces before you updated your packet
filtering rules, you already had a window where packets would come in
with the old rules, so doing a "synchronize_net()" in no way protects
against any race conditions anyway.
Am I missing something?
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
- From: Paul E. McKenney
- Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
- References:
- iptables very slow after commit784544739a25c30637397ace5489eeb6e15d7d49
- From: Jeff Chua
- Re: iptables very slow after commit784544739a25c30637397ace5489eeb6e15d7d49
- From: Stephen Hemminger
- Re: iptables very slow after commit784544739a25c30637397ace5489eeb6e15d7d49
- From: David Miller
- Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
- From: Linus Torvalds
- Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
- From: Paul E. McKenney
- iptables very slow after commit784544739a25c30637397ace5489eeb6e15d7d49
- Prev by Date: Re: [PATCH 1/1] agnx: replace print_mac with %pM
- Next by Date: Re: [linux-pm] [2.6.30-rc1-git2 regressions] Hibernation broken and (minor but annoying) audio problem
- Previous by thread: Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
- Next by thread: Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49
- Index(es):
Relevant Pages
|