Commit c5e4af1e authored by Patrick McHardy's avatar Patrick McHardy Committed by Patrick McHardy

[NETFILTER]: Add size check for udp packet mangling.

parent 4125458a
......@@ -217,6 +217,12 @@ ip_nat_mangle_udp_packet(struct sk_buff **pskb,
struct iphdr *iph;
struct udphdr *udph;
/* UDP helpers might accidentally mangle the wrong packet */
iph = (*pskb)->nh.iph;
if ((*pskb)->len < iph->ihl*4 + sizeof(*udph) +
match_offset + match_len)
return 0;
if (!skb_ip_make_writable(pskb, (*pskb)->len))
return 0;
......
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