]> 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)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 16 Mar 2020 10:13:48 +0000 (11:13 +0100)
commit66422983a070f0519f68bdb8ef9acf0a4d827c02
treefc73994b4d93542e0e8a36113414067a642ccc51
parentf6cfdfb72c1903fa135271fa0fe8eb83a596f762
vti6: Fix memory leak of skb if input policy check fails

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>
net/ipv6/ip6_vti.c