Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1986614imu; Fri, 14 Dec 2018 04:06:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/WumMwejds8YZb5F3wLaBXkfql60CNjcsj0r85Iqp6J/at/tv0j91R3jabg8FarFoX0M+ZH X-Received: by 2002:a17:902:1e9:: with SMTP id b96mr2637447plb.150.1544789216770; Fri, 14 Dec 2018 04:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544789216; cv=none; d=google.com; s=arc-20160816; b=AKw++EiT8yXNNyk2VT6jGOCyAxOV7RJrD272cp+kscdnFYU/azTF4BzXl3iEOmHbpR wL5p/K9Ez/cQD2w6q2rbm1+br5nqN5BGjOsthlbXT+vW7kfNwTqy+SdUvtRAHXQVVuY3 gfSHCrz4Fi8Gok0fdvtJXLpPXEY/opsMqeG3dPzBBA2rMYXIah0G871O+RJwvDWseqkI +wtr907t233/t93srlo8sF+cxgrjZneiMCMet7/5tRgNgWbmqhWQrqP3JH/TRtGD9R0o G6nnuXhMXpkJq9luxoZXKL5D6A5DRzsG2am1gim2RzIdJ3/RriSG5l1EiJ71HkN1dVE0 3A0w== 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=KPr6ylvw86UCbVIAoTZGT4AsbLT5kpSLmaMy8LqyQQU=; b=Vja8zVAt6S/Yf2JKi8/5pD233JT8cKnDr+lMF9QQhxjOucwhmjk+BbIf89otcaVcO4 dMR7qs97Rfg4GSCbbCg507eGIx3XGL3rcKh48OHN4/gSdff6CyCXCFgYl6BBU8NmlF33 pH4jBhMHywHX8qVtdP+pp8F6zpGA31oVD0vVNSxabmpuKcM7IG0zgvaOhCZDHrFzhypn DNuYl5Vwkov9ZOkvqiJHV+VvEShOdMR9OpuF1RgQzq6SwvuVsVFOBeTnuuop4ucE/UUl 6HVA7+Bqa89WK4fIbls4E3+ha5eoGbjVmbOuHFjdTOte/4OMupJtJb+BPocmARb96UI2 ox8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZRwNNqLZ; 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 31si4102765plh.274.2018.12.14.04.06.42; Fri, 14 Dec 2018 04:06:56 -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=ZRwNNqLZ; 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 S1730542AbeLNMEg (ORCPT + 99 others); Fri, 14 Dec 2018 07:04:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:49260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729989AbeLNMEd (ORCPT ); Fri, 14 Dec 2018 07:04:33 -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 64F3D214AC; Fri, 14 Dec 2018 12:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789072; bh=MEYWtgx3xk8MXukF4jf1bvKXyRPrDZwFe3M51638ABg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZRwNNqLZq+rlp/km3G9NNRK3Cu4U30ht4J2LybjX4QvVILixB3rT9XrE04PVR1D+c 2QsuPRZwEPHnio87PFd84nlk6PV2xel048sKLbkbFhJyXi6JV7xS9xpTVV4zwKgakw jM55N0k4fRQCky++NFJrdBvELgrQq7JKrnPHdkkg= 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.19 084/142] ipvs: call ip_vs_dst_notifier earlier than ipv6_dev_notf Date: Fri, 14 Dec 2018 12:59:29 +0100 Message-Id: <20181214115750.420939160@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115747.053633987@linuxfoundation.org> References: <20181214115747.053633987@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.19-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 62eefea48973..518364f4abcc 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -3980,6 +3980,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