From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D98B7C04AB4 for ; Thu, 16 May 2019 11:41:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2A95216FD for ; Thu, 16 May 2019 11:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558006873; bh=ARSnX5PfxluCo5dLGHRAKnhNTvSby6tcAwW2X3WgoCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UmfYYdoNAFdiIjPz0pgBKOOUHcUjWrCXVy+ISjSxF76/47XG4StFJ/rzigmy6/2jF BCadJCthPXuJQqu4TFIpyIfy/6X8E4fGPVK3/gi6LiQSSzGlUIcHoGQYnbX6zj4Bvq xE2WtwTd5G+U8lxFNBpSw8Y99pBcqOFySwGkZ6e4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728037AbfEPLlM (ORCPT ); Thu, 16 May 2019 07:41:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:49824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728027AbfEPLlM (ORCPT ); Thu, 16 May 2019 07:41:12 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0839F216F4; Thu, 16 May 2019 11:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558006871; bh=ARSnX5PfxluCo5dLGHRAKnhNTvSby6tcAwW2X3WgoCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IozY+mCxoltI1rGqIBOnvlNY9JOWrgjBEPKyRnVuvl8L6GOfz7TMy21b6UCR721bY Xfs3+4PXyL5HCIcyJDTfnl0gmXHZ0024ZVt+VIUD3MX3WByENyAAXITrDkplMH5gfB 9T436MHWPsTbvZkXXxoufDe6FT1eEsGNWC6pnqgE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jeremy Sowden , Steffen Klassert , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 03/16] vti4: ipip tunnel deregistration fixes. Date: Thu, 16 May 2019 07:40:54 -0400 Message-Id: <20190516114107.8963-3-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190516114107.8963-1-sashal@kernel.org> References: <20190516114107.8963-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jeremy Sowden [ Upstream commit 5483844c3fc18474de29f5d6733003526e0a9f78 ] If tunnel registration failed during module initialization, the module would fail to deregister the IPPROTO_COMP protocol and would attempt to deregister the tunnel. The tunnel was not deregistered during module-exit. Fixes: dd9ee3444014e ("vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel") Signed-off-by: Jeremy Sowden Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- net/ipv4/ip_vti.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index 306603a7f3514..c07065b7e3b0e 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c @@ -663,9 +663,9 @@ static int __init vti_init(void) return err; rtnl_link_failed: - xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP); -xfrm_tunnel_failed: xfrm4_tunnel_deregister(&ipip_handler, AF_INET); +xfrm_tunnel_failed: + xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP); xfrm_proto_comp_failed: xfrm4_protocol_deregister(&vti_ah4_protocol, IPPROTO_AH); xfrm_proto_ah_failed: @@ -680,6 +680,7 @@ static int __init vti_init(void) static void __exit vti_fini(void) { rtnl_link_unregister(&vti_link_ops); + xfrm4_tunnel_deregister(&ipip_handler, AF_INET); xfrm4_protocol_deregister(&vti_ipcomp4_protocol, IPPROTO_COMP); xfrm4_protocol_deregister(&vti_ah4_protocol, IPPROTO_AH); xfrm4_protocol_deregister(&vti_esp4_protocol, IPPROTO_ESP); -- 2.20.1