diff options
| author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-02-17 01:43:47 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:27:11 -0500 |
| commit | 8a5ce54562f296b1996813a413b0f2307ec9351a (patch) | |
| tree | 7b61599a7adc3d050e9ca1cbe89211088addbe0c | |
| parent | 9f0beba9f90847db7ba6ed894f7c87b6038a5bce (diff) | |
xt_hashlimit: fix locking
Commit 2eff25c18c3d332d3c4dd98f2ac9b7114e9771b0
(netfilter: xt_hashlimit: fix race condition and simplify locking)
added a mutex deadlock :
htable_create() is called with hashlimit_mutex already locked
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/netfilter/xt_hashlimit.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index e47fb805ffb4..d952806b6469 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
| @@ -262,9 +262,7 @@ static int htable_create_v0(struct net *net, struct xt_hashlimit_info *minfo, u_ | |||
| 262 | hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); | 262 | hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); |
| 263 | add_timer(&hinfo->timer); | 263 | add_timer(&hinfo->timer); |
| 264 | 264 | ||
| 265 | mutex_lock(&hashlimit_mutex); | ||
| 266 | hlist_add_head(&hinfo->node, &hashlimit_net->htables); | 265 | hlist_add_head(&hinfo->node, &hashlimit_net->htables); |
| 267 | mutex_unlock(&hashlimit_mutex); | ||
| 268 | 266 | ||
| 269 | return 0; | 267 | return 0; |
| 270 | } | 268 | } |
| @@ -327,9 +325,7 @@ static int htable_create(struct net *net, struct xt_hashlimit_mtinfo1 *minfo, | |||
| 327 | hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); | 325 | hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); |
| 328 | add_timer(&hinfo->timer); | 326 | add_timer(&hinfo->timer); |
| 329 | 327 | ||
| 330 | mutex_lock(&hashlimit_mutex); | ||
| 331 | hlist_add_head(&hinfo->node, &hashlimit_net->htables); | 328 | hlist_add_head(&hinfo->node, &hashlimit_net->htables); |
| 332 | mutex_unlock(&hashlimit_mutex); | ||
| 333 | 329 | ||
| 334 | return 0; | 330 | return 0; |
| 335 | } | 331 | } |
