]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vti6: Fix memory leak of skb if input policy check fails
authorTorsten Hilbrich <torsten.hilbrich@secunet.com>
Wed, 11 Mar 2020 10:19:06 +0000 (11:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:00:20 +0000 (11:00 +0200)
commit7bab4e5b997be19eeb29c61c4bcc1eed4a6961f9
treece6128371743b63079932798ec7074f8b2223700
parent273d30a0add12f09886d97dd533fb212bc1e679b
vti6: Fix memory leak of skb if input policy check fails

commit 2a9de3af21aa8c31cd68b0b39330d69f8c1e59df upstream.

The vti6_rcv function performs some tests on the retrieved tunnel
including checking the IP protocol, the XFRM input policy, the
source and destination address.

In all but one places the skb is released in the error case. When
the input policy check fails the network packet is leaked.

Using the same goto-label discard in this case to fix this problem.

Fixes: ed1efb2aefbb ("ipv6: Add support for IPsec virtual tunnel interfaces")
Signed-off-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/ip6_vti.c