netfilter: ipv6: fix crash caused by ipv6_find_hdr()
authorJP Abgrall <jpa@google.com>
Thu, 29 Sep 2011 22:36:49 +0000 (15:36 -0700)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:24:39 +0000 (12:24 -0800)
commitcd498d1391672fa8af40e4a3bdb259c50b750853
tree70319240af0a4fd238db0a6b6b10d6a234a53e0e
parent0a7f13c773d839587c2edf4bf652649cf429586b
netfilter: ipv6: fix crash caused by ipv6_find_hdr()

When calling:
    ipv6_find_hdr(skb, &thoff, -1, NULL)
on a fragmented packet, thoff would be left with a random
value causing callers to read random memory offsets with:
    skb_header_pointer(skb, thoff, ...)

Now we force ipv6_find_hdr() to return a failure in this case.
Calling:
  ipv6_find_hdr(skb, &thoff, -1, &fragoff)
will set fragoff as expected, and not return a failure.

Change-Id: Ib474e8a4267dd2b300feca325811330329684a88
Signed-off-by: JP Abgrall <jpa@google.com>
net/ipv6/netfilter/ip6_tables.c