[NETFILTER]: ip_tables: fix table locking in ipt_do_table
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>
This commit is contained in:
committed by
David S. Miller
parent
d205dc4079
commit
8311731afc
@@ -230,7 +230,7 @@ ipt_do_table(struct sk_buff **pskb,
|
|||||||
const char *indev, *outdev;
|
const char *indev, *outdev;
|
||||||
void *table_base;
|
void *table_base;
|
||||||
struct ipt_entry *e, *back;
|
struct ipt_entry *e, *back;
|
||||||
struct xt_table_info *private = table->private;
|
struct xt_table_info *private;
|
||||||
|
|
||||||
/* Initialization */
|
/* Initialization */
|
||||||
ip = (*pskb)->nh.iph;
|
ip = (*pskb)->nh.iph;
|
||||||
@@ -247,6 +247,7 @@ ipt_do_table(struct sk_buff **pskb,
|
|||||||
|
|
||||||
read_lock_bh(&table->lock);
|
read_lock_bh(&table->lock);
|
||||||
IP_NF_ASSERT(table->valid_hooks & (1 << hook));
|
IP_NF_ASSERT(table->valid_hooks & (1 << hook));
|
||||||
|
private = table->private;
|
||||||
table_base = (void *)private->entries[smp_processor_id()];
|
table_base = (void *)private->entries[smp_processor_id()];
|
||||||
e = get_entry(table_base, private->hook_entry[hook]);
|
e = get_entry(table_base, private->hook_entry[hook]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user