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 10:54:16 +0000 (12:54 +0200)
commit22315daf2f6f19bdfd804450ac35f9ba925d2472
tree6d1b79bcda540d8a02d9d22694c7c2ce1094a781
parentbca288c7932253f0f12c8facc65406e1ff43ae8b
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