ipv6: Fix leak in ipv6_gso_segment().
authorDavid S. Miller <davem@davemloft.net>
Mon, 5 Jun 2017 01:41:10 +0000 (21:41 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2017 11:16:19 +0000 (13:16 +0200)
commit406752726afc5295bf77dc6b82ee1c6e626b2d56
treee5e393bf4126b35b59ac64e2c84d6d87f65de58b
parent92d88e8a7adc83568e64946e422da9f1f03dfa2d
ipv6: Fix leak in ipv6_gso_segment().

[ Upstream commit e3e86b5119f81e5e2499bea7ea1ebe8ac6aab789 ]

If ip6_find_1stfragopt() fails and we return an error we have to free
up 'segs' because nobody else is going to.

Fixes: 2423496af35d ("ipv6: Prevent overrun when parsing v6 header options")
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/ip6_offload.c