diff options
-rw-r--r-- | net/ipv4/netfilter/ip_queue.c | 5 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_queue.c | 5 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_queue.c | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 719be29f7506..26a37cedcf2e 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -296,9 +296,8 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct nf_queue_entry *e) | |||
296 | if (v->data_len > 0xFFFF) | 296 | if (v->data_len > 0xFFFF) |
297 | return -EINVAL; | 297 | return -EINVAL; |
298 | if (diff > skb_tailroom(e->skb)) { | 298 | if (diff > skb_tailroom(e->skb)) { |
299 | nskb = skb_copy_expand(e->skb, 0, | 299 | nskb = skb_copy_expand(e->skb, skb_headroom(e->skb), |
300 | diff - skb_tailroom(e->skb), | 300 | diff, GFP_ATOMIC); |
301 | GFP_ATOMIC); | ||
302 | if (!nskb) { | 301 | if (!nskb) { |
303 | printk(KERN_WARNING "ip_queue: error " | 302 | printk(KERN_WARNING "ip_queue: error " |
304 | "in mangle, dropping packet\n"); | 303 | "in mangle, dropping packet\n"); |
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index 92a36c9e5402..2eff3ae8977d 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
@@ -298,9 +298,8 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct nf_queue_entry *e) | |||
298 | if (v->data_len > 0xFFFF) | 298 | if (v->data_len > 0xFFFF) |
299 | return -EINVAL; | 299 | return -EINVAL; |
300 | if (diff > skb_tailroom(e->skb)) { | 300 | if (diff > skb_tailroom(e->skb)) { |
301 | nskb = skb_copy_expand(e->skb, 0, | 301 | nskb = skb_copy_expand(e->skb, skb_headroom(e->skb), |
302 | diff - skb_tailroom(e->skb), | 302 | diff, GFP_ATOMIC); |
303 | GFP_ATOMIC); | ||
304 | if (!nskb) { | 303 | if (!nskb) { |
305 | printk(KERN_WARNING "ip6_queue: OOM " | 304 | printk(KERN_WARNING "ip6_queue: OOM " |
306 | "in mangle, dropping packet\n"); | 305 | "in mangle, dropping packet\n"); |
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 2c9fe5c12894..3447025ce068 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
@@ -454,9 +454,8 @@ nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e) | |||
454 | if (data_len > 0xFFFF) | 454 | if (data_len > 0xFFFF) |
455 | return -EINVAL; | 455 | return -EINVAL; |
456 | if (diff > skb_tailroom(e->skb)) { | 456 | if (diff > skb_tailroom(e->skb)) { |
457 | nskb = skb_copy_expand(e->skb, 0, | 457 | nskb = skb_copy_expand(e->skb, skb_headroom(e->skb), |
458 | diff - skb_tailroom(e->skb), | 458 | diff, GFP_ATOMIC); |
459 | GFP_ATOMIC); | ||
460 | if (!nskb) { | 459 | if (!nskb) { |
461 | printk(KERN_WARNING "nf_queue: OOM " | 460 | printk(KERN_WARNING "nf_queue: OOM " |
462 | "in mangle, dropping packet\n"); | 461 | "in mangle, dropping packet\n"); |