Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2187385ybm; Thu, 23 May 2019 12:48:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRC2qYR3FPKrb9q3p5ODwrjlzDbrgIaubdM/vJd8rvTAwkfPgQ4KarITGfhQ+2HMFfphK+ X-Received: by 2002:a17:90a:5d09:: with SMTP id s9mr3674129pji.120.1558640902678; Thu, 23 May 2019 12:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558640902; cv=none; d=google.com; s=arc-20160816; b=SlTcEwI37qqn7Y/7svQBwdTcaXR7Xi/U1UYTXKZCLJozK5MeOMBhrwz9OmDMHlx7wE bNU1JnsU0PpUvSvXueaAdz+qxbTTVEZshFn3RJeYN/wycn2urQO5TwPZMietc+MF9lrt HhRSdFkI5r7OyYWA0D4VkbD5z82vJaPlwd4EtAoGLIu4C1fKNiP6H3Ty0S3H6O5zcvdX tPPT/j9mPeNc8NLiQlqGEwk6o7wR8T7UKlqAXH8tAiWrGj+CzNa/LTo1PaNcZk5Kyw7q j4dxwvrHMqn6NQ3tFb4wD3DiXi7EmO0pz4ltIFUZkWsAM2bBak/B81SJLs5R8Dw7f6cM wU/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=epidovC1VLTCoKA/3WAbjT2i/ngSauKE9kUSzImdUkw=; b=DdsPx8Ox75nvgjvpeA/NDCldtzj2Qm9sADbM73eMFNTo1/b5zga77A+FYr/MF1AMee KevMOmS4fZY8Ks08kaIAg4H5WNfEC1wCfrqaryeg/ePyxhcvCrH0XPVBUeCSeHTAAqWi cZlMIBg3CESrEGO2JIzxz3c9E8R/Qy0OkxKIgwSt8sYrGIG4D+GRBRHC1WaAHuEno4tK esHyKToDlwwRGfQzVYSAEI9QrkxhbvQSay2dFyZxWcr35QKNsdPZ71h7v2fsCgYmCwYD tet+VcnFlk9y62IJCgcMXpiTziQcOJccF+TRO/5u4PEtgSIfv8ORVCV5RxRB6pPGMWTn bZqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WvMpHzlG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n43si545375pjb.20.2019.05.23.12.48.07; Thu, 23 May 2019 12:48:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WvMpHzlG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388600AbfEWTNh (ORCPT + 99 others); Thu, 23 May 2019 15:13:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:47556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388598AbfEWTNc (ORCPT ); Thu, 23 May 2019 15:13:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BDC65217D9; Thu, 23 May 2019 19:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638812; bh=wNXeCosCK0QQxRV2HklD6rFDMFTsPt1jWFK64ZTf6dk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WvMpHzlGTxhH3L5KSGpztSJ+Quf81shyGCg+++QuDsBTnMIKMMec+nBXkTtkAUWX2 BRt2sYvE8rfnBtqSNoGXR/exPKBXaL5JqumjftFcIuRqL4gRK06ZkABCNBoulaPQDq m5T0iIMHk3/XeNfW+PjNEdSStYVexC/6ueaA8jJ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Su Yanjun , Herbert Xu , Steffen Klassert , Sasha Levin Subject: [PATCH 4.14 57/77] xfrm6_tunnel: Fix potential panic when unloading xfrm6_tunnel module Date: Thu, 23 May 2019 21:06:15 +0200 Message-Id: <20190523181727.792834031@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 6ee02a54ef990a71bf542b6f0a4e3321de9d9c66 ] When unloading xfrm6_tunnel module, xfrm6_tunnel_fini directly frees the xfrm6_tunnel_spi_kmem. Maybe someone has gotten the xfrm6_tunnel_spi, so need to wait it. Fixes: 91cc3bb0b04ff("xfrm6_tunnel: RCU conversion") Signed-off-by: Su Yanjun Acked-by: Herbert Xu Signed-off-by: Steffen Klassert Signed-off-by: Sasha Levin --- net/ipv6/xfrm6_tunnel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index c28e3eaad7c26..b51368ebd1e67 100644 --- a/net/ipv6/xfrm6_tunnel.c +++ b/net/ipv6/xfrm6_tunnel.c @@ -391,6 +391,10 @@ static void __exit xfrm6_tunnel_fini(void) xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6); xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6); unregister_pernet_subsys(&xfrm6_tunnel_net_ops); + /* Someone maybe has gotten the xfrm6_tunnel_spi. + * So need to wait it. + */ + rcu_barrier(); kmem_cache_destroy(xfrm6_tunnel_spi_kmem); } -- 2.20.1