]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.181/vti4-ipip-tunnel-deregistration-fixes.patch
Linux 4.9.181
[thirdparty/kernel/stable-queue.git] / releases / 4.4.181 / vti4-ipip-tunnel-deregistration-fixes.patch
1 From f668a8ba91f02a52b86a3a628606b186065fba92 Mon Sep 17 00:00:00 2001
2 From: Jeremy Sowden <jeremy@azazel.net>
3 Date: Tue, 19 Mar 2019 15:39:20 +0000
4 Subject: vti4: ipip tunnel deregistration fixes.
5
6 [ Upstream commit 5483844c3fc18474de29f5d6733003526e0a9f78 ]
7
8 If tunnel registration failed during module initialization, the module
9 would fail to deregister the IPPROTO_COMP protocol and would attempt to
10 deregister the tunnel.
11
12 The tunnel was not deregistered during module-exit.
13
14 Fixes: dd9ee3444014e ("vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel")
15 Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
16 Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
17 Signed-off-by: Sasha Levin <sashal@kernel.org>
18 ---
19 net/ipv4/ip_vti.c | 5 +++--
20 1 file changed, 3 insertions(+), 2 deletions(-)
21
22 --- a/net/ipv4/ip_vti.c
23 +++ b/net/ipv4/ip_vti.c
24 @@ -648,9 +648,9 @@ static int __init vti_init(void)
25 return err;
26
27 rtnl_link_failed:
28 - xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP);
29 -xfrm_tunnel_failed:
30 xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
31 +xfrm_tunnel_failed:
32 + xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP);
33 xfrm_proto_comp_failed:
34 xfrm4_protocol_deregister(&vti_ah4_protocol, IPPROTO_AH);
35 xfrm_proto_ah_failed:
36 @@ -666,6 +666,7 @@ pernet_dev_failed:
37 static void __exit vti_fini(void)
38 {
39 rtnl_link_unregister(&vti_link_ops);
40 + xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
41 xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP);
42 xfrm4_protocol_deregister(&vti_ah4_protocol, IPPROTO_AH);
43 xfrm4_protocol_deregister(&vti_esp4_protocol, IPPROTO_ESP);