Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2467322pxb; Mon, 19 Apr 2021 06:29:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzClF23GzijNsxhQrShY09eU3tDZvHBJFzTgpn7IDlMFKCftBMS+PP/Bc8HclASiM6ZkbgU X-Received: by 2002:aa7:c683:: with SMTP id n3mr25070111edq.214.1618838940315; Mon, 19 Apr 2021 06:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618838940; cv=none; d=google.com; s=arc-20160816; b=LVvQ98y1Gz2aBFdCx71wn9phKORCsPoLAWWHcBUvLix3BljEYuP/0uFYqy0wBDna00 rhStTRCH1oW6mktexCCR11rcwpm+praW8WNrsQjbOHI3ViGMtYEkMTvTWN3dASzP4/2j 2oK+tCpabZzfc5PZ64OvDwDRNtZyJJsi/ND5MyuO4YJ1NR6FKIsx88wn77/KCQJgioWE HdMYVUWFgE6h5l6ASCdcd+sC428mA0CsWgcheS7J71mRdx8c2Xeft92+fe9ly+joILnf 3ZoOnhlAq83LfSGWLMXkbPJGTiDAxEkdO1LvG3yW8qK7WRNxorwQtivwTvltsPs2T2Od BxwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LPDjV0Gzo1duLjNYdgnGXMjsBrqc3iYZ54kuRdfjUOI=; b=fKUT5OPEH+8RlVxUMyy3UZDMC9pwU7cX+Yvc2J1AApn8JwpZXLU21fL5lAwvVQvmrk /NcFr75V0DsyVJ3mLLAL+mett/3Uum/DSvNhzuudWBMN8/83a/6Yk8V71SlmO8BB9dja 2friRpHb4VdVGca0u+6Ga0UAYt4aKqCLoW6FomhtarHhjVaGyUdYRJg9+HI/bFRLjqi+ 2BOHirpaoapgLgM8Pz0bckkOcWxgzV4KaXZseHzbgW5QjIlvanTxuN/f+0PHSXm6ZISX 0z6L3EqLeOMHQU9knF6JhX3piq9yoyoZ/juVjGRB7Lg1g9740VDS8sG4Rn8/DGT3vqJn GlJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ny+ekhAy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h21si2621840ede.377.2021.04.19.06.28.36; Mon, 19 Apr 2021 06:29:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ny+ekhAy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240708AbhDSN1P (ORCPT + 99 others); Mon, 19 Apr 2021 09:27:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:56792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241359AbhDSNU1 (ORCPT ); Mon, 19 Apr 2021 09:20:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5723C613E8; Mon, 19 Apr 2021 13:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838181; bh=fN2mtwZZeJajqB6xdE9xvau7nZPC4vSVWR80iu+0jww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ny+ekhAydZ6PKlwJfnegT+xPXjhRjvtjU++rbzqydNlTE647EN6yhW+L0Cz/UFssi Eydx45e/jI+CPBcsh+oCfJZAqY3oJJQHxLfrDK44Fm3i4KCE6e6O9S+kz85XUAudul uWj9XoXQGX0NLg4R7o54gRbLX21uWt68sIgZdR+s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hristo Venev , "David S. Miller" Subject: [PATCH 5.10 071/103] net: ip6_tunnel: Unregister catch-all devices Date: Mon, 19 Apr 2021 15:06:22 +0200 Message-Id: <20210419130530.255356635@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hristo Venev commit 941ea91e87a6e879ed82dad4949f6234f2702bec upstream. Similarly to the sit case, we need to remove the tunnels with no addresses that have been moved to another network namespace. Fixes: 0bd8762824e73 ("ip6tnl: add x-netns support") Signed-off-by: Hristo Venev Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_tunnel.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -2275,6 +2275,16 @@ static void __net_exit ip6_tnl_destroy_t t = rtnl_dereference(t->next); } } + + t = rtnl_dereference(ip6n->tnls_wc[0]); + while (t) { + /* If dev is in the same netns, it has already + * been added to the list by the previous loop. + */ + if (!net_eq(dev_net(t->dev), net)) + unregister_netdevice_queue(t->dev, list); + t = rtnl_dereference(t->next); + } } static int __net_init ip6_tnl_init_net(struct net *net)