Received: by 10.192.165.156 with SMTP id m28csp53920imm; Tue, 10 Apr 2018 16:14:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/BFU8Ko08D0gG3MXgFxZ6A82v3dWTrVUHeuxktBvcwjtA5gyMbaeYEIa6OKOzXl/YTwAGM X-Received: by 2002:a17:902:6b86:: with SMTP id p6-v6mr2391972plk.32.1523402091422; Tue, 10 Apr 2018 16:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523402091; cv=none; d=google.com; s=arc-20160816; b=cCUFK8LwfwAsLnw/BjM2YzLEPgzb3cFVwc2As+NpSgNrc4cnxLt1bxjdMHP5w3aop6 rJ4PYuC8LVJ8YmnwyVoYAdS/Z37D8tVwbKiFFc+53FbnabzR/u8oeSHz2+r2uGvSQQ9E 4DsaGGsR1yGJirYlDEW192QrRfGsU8wb4su7ZbTiDlciQj0nJZKylNMxuR2ABfVlJxsL qrFwJIbSPChJzyY6/FDDXhiOEYK13b9IiXD1jaQ1Nn3ViEdmFvQtwJnw2D50bJhD42mz 5zMgivGLIxRuqOPugJ/8OxWuDn90SBRcRMzPx6jxuLM8U4FqDw9p7+9nxDptrlwOxocb W54A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6fsfoEBK+8UHLmmrFZfx7pm1e7ACfAnxxUh95UjD3oc=; b=VjAmbjTPZ3N8tZuia4ikZzcXiGg8WPAwuFm+pRyKStgfauFKAn6wO0u8bh3Wb5Zybn Flb6lin5XKZnXRE5YxqPkJo1Q7YqD0zyafyUOt6qBRCbxwu6otNen4uJ67dSE87qtn11 k1eJmEF6WdfYkZhAMd9tCKJRx6UPtaTsTQSExzmggXop8lHgEgjnUdlbiMXv1QzRO6s/ vPDs8qbRHtGbHM0PR2FUHvkFGMpxJ9syiaEJfjEQorlS6ef3Tv92kVzp2GExs42he9py OGaQFDuTMC/bSxN/MYRMhruKEJePXFQyohE/WzrvnRHyUkPHxlV0YUWMWB+336KiHodV DHKA== ARC-Authentication-Results: i=1; mx.google.com; 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 j7si2365735pgq.426.2018.04.10.16.14.14; Tue, 10 Apr 2018 16:14:51 -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; 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 S932094AbeDJWdU (ORCPT + 99 others); Tue, 10 Apr 2018 18:33:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41242 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755146AbeDJWdQ (ORCPT ); Tue, 10 Apr 2018 18:33:16 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F25D3C8D; Tue, 10 Apr 2018 22:33:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , Jiri Pirko , "David S. Miller" Subject: [PATCH 4.15 166/168] team: move dev_mc_sync after master_upper_dev_link in team_port_add Date: Wed, 11 Apr 2018 00:25:08 +0200 Message-Id: <20180410212808.289995216@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long [ Upstream commit 982cf3b3999d39a2eaca0a65542df33c19b5d814 ] The same fix as in 'bonding: move dev_mc_sync after master_upper_dev_link in bond_enslave' is needed for team driver. The panic can be reproduced easily: ip link add team1 type team ip link set team1 up ip link add link team1 vlan1 type vlan id 80 ip link set vlan1 master team1 Fixes: cb41c997d444 ("team: team should sync the port's uc/mc addrs when add a port") Signed-off-by: Xin Long Acked-by: Jiri Pirko Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/team/team.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -1197,11 +1197,6 @@ static int team_port_add(struct team *te goto err_dev_open; } - netif_addr_lock_bh(dev); - dev_uc_sync_multiple(port_dev, dev); - dev_mc_sync_multiple(port_dev, dev); - netif_addr_unlock_bh(dev); - err = vlan_vids_add_by_dev(port_dev, dev); if (err) { netdev_err(dev, "Failed to add vlan ids to device %s\n", @@ -1241,6 +1236,11 @@ static int team_port_add(struct team *te goto err_option_port_add; } + netif_addr_lock_bh(dev); + dev_uc_sync_multiple(port_dev, dev); + dev_mc_sync_multiple(port_dev, dev); + netif_addr_unlock_bh(dev); + port->index = -1; list_add_tail_rcu(&port->list, &team->port_list); team_port_enable(team, port); @@ -1265,8 +1265,6 @@ err_enable_netpoll: vlan_vids_del_by_dev(port_dev, dev); err_vids_add: - dev_uc_unsync(port_dev, dev); - dev_mc_unsync(port_dev, dev); dev_close(port_dev); err_dev_open: