]> git.baikalelectronics.ru Git - kernel.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:02:12 +0000 (11:02 +0200)
commit02f3450dd4db03a644b89e2ae2ddcb75b1f6f1cc
treeeab2400d8f16297d98c4a45236c512d51cac2dba
parentf828ab0a35f7e9a9d7681584f41bb55b12e9bc3f
vti6: Fix memory leak of skb if input policy check fails

commit 66422983a070f0519f68bdb8ef9acf0a4d827c02 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: 362a48aabff4 ("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