Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2009423imu; Fri, 14 Dec 2018 04:26:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/W4OOELhVYnr2ozFOIFmSPIiWhOzYwaA8zbzTSfPZ8/ZH5U90+Rb8uUGCs7M7QbOgRtIINA X-Received: by 2002:a62:c505:: with SMTP id j5mr2642455pfg.149.1544790419331; Fri, 14 Dec 2018 04:26:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544790419; cv=none; d=google.com; s=arc-20160816; b=YPQ6eBb4MFQzrGSHD5NjrtjfD+m+A9lPKNTg8JjdTzozNsA1tXQtxhc61Brea4SEK5 KXX8/oUNn2H0YXxgICXElDHom8ct+ATPOMz1CdteBd1VkoKHhSXGwSF0X0ASvKu2E2mu LsqpDOfaO2Un5FTN0fGezTfE8UgLHgxCwSIx/n6aHsAvrHa4gnvO2bEdxZOrS1k8CI4W XE/131LRWwgMhDWJg9H1iwZkjvnN/nbC20h5+mdOv0FiE39b7gC8ssC3GFk80iEKyjNg UNd7s9QhwH5T/v9sJxidlb3iIWvaSb4/tNSEBO2x33F7UKsnKSkRUAYSpmiv0o0jKsEW 8RWg== 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=Tv6Hov6OPvmQKsi4ZXb4GZsXVL3v0rIrnVTucWqTCK0=; b=o7dmr2s6T1IxbxQS8NY7+fX2h1SnMH5x1ZN5xKlR+vF2OLkEVEGaZN+1ozwTUZVlOx nED+WE+tz61/jB6oDWN9X870qmypFAc3VUJrExNVFtdvololMKuNSqXY0kS7m0y+5cwG 6bpOQ8d6dGE87OdQIUCkTb2YFGSK10wP5vqH3TGEYw2RDeZJkvHCiqGu9sSOnlfgEX9J zWb1EStYrA9cqIDuq2QwrB7JTX+E++CgbcOT9UdVK4e21ftnNQnWfmjOciloyk+y0Kh/ O0Ym5NFojY6T74lybDNkNkcmiV6b76Baji5tqGsWQxLdltT1Il6NSHphVt+7keNfUF9h x9zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q/40JYfP"; 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 z67si4060802pfb.268.2018.12.14.04.26.42; Fri, 14 Dec 2018 04:26:59 -0800 (PST) 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="Q/40JYfP"; 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 S1730189AbeLNMZv (ORCPT + 99 others); Fri, 14 Dec 2018 07:25:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:59282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730503AbeLNMML (ORCPT ); Fri, 14 Dec 2018 07:12:11 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 4ECBE214F0; Fri, 14 Dec 2018 12:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789530; bh=dDLbsdel/7QiDwSITsAHy1OO3Ask0lyU/Eut54q6+2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q/40JYfPCIN0E7sjJT5Oww7ocvTFwsLyxxeh/ElO3jQs615vcRD1y6LPtcvE+bBtw NRbuAcY1Fn/QZb9mBHgXsQTA/h5f8Uh3SPPZjesJrRIWCeDki7WBVuu57KAXJzvRfm FMO5ZWDFjAwef8Ag9nJjiu7Oquksfd4zOfSIiISY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Shuang , Xin Long , Julian Anastasov , Simon Horman , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 4.9 29/51] ipvs: call ip_vs_dst_notifier earlier than ipv6_dev_notf Date: Fri, 14 Dec 2018 13:00:31 +0100 Message-Id: <20181214115715.924598638@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115713.244259772@linuxfoundation.org> References: <20181214115713.244259772@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 2a31e4bd9ad255ee40809b5c798c4b1c2b09703b ] ip_vs_dst_event is supposed to clean up all dst used in ipvs' destinations when a net dev is going down. But it works only when the dst's dev is the same as the dev from the event. Now with the same priority but late registration, ip_vs_dst_notifier is always called later than ipv6_dev_notf where the dst's dev is set to lo for NETDEV_DOWN event. As the dst's dev lo is not the same as the dev from the event in ip_vs_dst_event, ip_vs_dst_notifier doesn't actually work. Also as these dst have to wait for dest_trash_timer to clean them up. It would cause some non-permanent kernel warnings: unregister_netdevice: waiting for br0 to become free. Usage count = 3 To fix it, call ip_vs_dst_notifier earlier than ipv6_dev_notf by increasing its priority to ADDRCONF_NOTIFY_PRIORITY + 5. Note that for ipv4 route fib_netdev_notifier doesn't set dst's dev to lo in NETDEV_DOWN event, so this fix is only needed when IP_VS_IPV6 is defined. Fixes: 7a4f0761fce3 ("IPVS: init and cleanup restructuring") Reported-by: Li Shuang Signed-off-by: Xin Long Acked-by: Julian Anastasov Acked-by: Simon Horman Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/ipvs/ip_vs_ctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 079b3c426720..8382b7880b24 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -4013,6 +4013,9 @@ static void __net_exit ip_vs_control_net_cleanup_sysctl(struct netns_ipvs *ipvs) static struct notifier_block ip_vs_dst_notifier = { .notifier_call = ip_vs_dst_event, +#ifdef CONFIG_IP_VS_IPV6 + .priority = ADDRCONF_NOTIFY_PRIORITY + 5, +#endif }; int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs) -- 2.19.1