Skip to content

Commit

Permalink
[NETFILTER]: ip_tables: fix table locking in ipt_do_table
Browse files Browse the repository at this point in the history
table->private might change because of ruleset changes, don't use it without
holding the lock.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Aug 18, 2006
1 parent d205dc4 commit 8311731
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/netfilter/ip_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ ipt_do_table(struct sk_buff **pskb,
const char *indev, *outdev;
void *table_base;
struct ipt_entry *e, *back;
struct xt_table_info *private = table->private;
struct xt_table_info *private;

/* Initialization */
ip = (*pskb)->nh.iph;
Expand All @@ -247,6 +247,7 @@ ipt_do_table(struct sk_buff **pskb,

read_lock_bh(&table->lock);
IP_NF_ASSERT(table->valid_hooks & (1 << hook));
private = table->private;
table_base = (void *)private->entries[smp_processor_id()];
e = get_entry(table_base, private->hook_entry[hook]);

Expand Down

0 comments on commit 8311731

Please sign in to comment.