Commit d97a9e47 authored by Jan Engelhardt's avatar Jan Engelhardt Committed by Patrick McHardy

netfilter: x_tables: move sleeping allocation outside BH-disabled region

The jumpstack allocation needs to be moved out of the critical region.
Corrects this notice:

BUG: sleeping function called from invalid context at mm/slub.c:1705
[  428.295762] in_atomic(): 1, irqs_disabled(): 0, pid: 9111, name: iptables
[  428.295771] Pid: 9111, comm: iptables Not tainted 2.6.34-rc1 #2
[  428.295776] Call Trace:
[  428.295791]  [<c012138e>] __might_sleep+0xe5/0xed
[  428.295801]  [<c019e8ca>] __kmalloc+0x92/0xfc
[  428.295825]  [<f865b3bb>] ? xt_jumpstack_alloc+0x36/0xff [x_tables]
Signed-off-by: default avatarJan Engelhardt <jengelh@medozas.de>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 6c79bf0f
...@@ -801,6 +801,12 @@ xt_replace_table(struct xt_table *table, ...@@ -801,6 +801,12 @@ xt_replace_table(struct xt_table *table,
struct xt_table_info *private; struct xt_table_info *private;
int ret; int ret;
ret = xt_jumpstack_alloc(newinfo);
if (ret < 0) {
*error = ret;
return NULL;
}
/* Do the substitution. */ /* Do the substitution. */
local_bh_disable(); local_bh_disable();
private = table->private; private = table->private;
...@@ -814,12 +820,6 @@ xt_replace_table(struct xt_table *table, ...@@ -814,12 +820,6 @@ xt_replace_table(struct xt_table *table,
return NULL; return NULL;
} }
ret = xt_jumpstack_alloc(newinfo);
if (ret < 0) {
*error = ret;
return NULL;
}
table->private = newinfo; table->private = newinfo;
newinfo->initial_entries = private->initial_entries; newinfo->initial_entries = private->initial_entries;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment