[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49CA5B47.4010400@trash.net>
Date: Wed, 25 Mar 2009 17:26:47 +0100
From: Patrick McHardy <kaber@...sh.net>
To: Eric Dumazet <dada1@...mosbay.com>
CC: mbizon@...ebox.fr, "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Joakim Tjernlund <Joakim.Tjernlund@...nsmode.se>,
avorontsov@...mvista.com, netdev@...r.kernel.org
Subject: Re: [PATCH] netfilter: Use hlist_add_head_rcu() in nf_conntrack_set_hashsize()
Eric Dumazet wrote:
> While working on this stuff, I found one suspect use of hlist_add_head()
>
> Its not a hot path, I believe following patch would make sure nothing
> wrong happens.
>
> If a chain contains element A and B, then we might build a new table
> with a new chain containing B and A (in this reverse order), and
> a cpu could see A->next = B (new pointer), B->next = A (old pointer)
I think you're right.
> [PATCH] netfilter: Use hlist_add_head_rcu() in nf_conntrack_set_hashsize()
>
> Using hlist_add_head() in nf_conntrack_set_hashsize() is quite dangerous.
> Without any barrier, one CPU could see a loop while doing its lookup.
> Its true new table cannot be seen by another cpu, but previous table is still
> readable.
Applied, thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists