Received: by 10.192.165.156 with SMTP id m28csp1094587imm; Wed, 11 Apr 2018 12:18:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx49L/6/KgI+aec4OpuAW9t5vytyaAAJocP26CmhmU97L04qeGQNX5q0Zb+sRA53DPMTQIgW6 X-Received: by 10.99.152.68 with SMTP id l4mr4259690pgo.75.1523474287301; Wed, 11 Apr 2018 12:18:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523474287; cv=none; d=google.com; s=arc-20160816; b=rU5zDJ5toCLZ+WRWzXM+YFxs4RQM26kpwneU47bkq5AaJdb94JWxPM8vxWP1+ND8l+ 9s8XUAObbvXnHTBHwXlNIh1QwijVn78UbjGuFJSgkp61FOlU57arsN0bLvSCqoDPjt8H XIpUcVd7puYHftckUx1SqKLfVZJkfpdEX2cisCFCjasePZPUDmNVMbJZt6vLDg02Wn9q evvZgyylT5vndyEsZtz8SXVDelMYJakRXBq7nzaXdc7+bbLcc0R5wUbCwDPZbEihKwO/ pOtWIQpR5+eKFACoGFmhQCd8+7H2xWgdN0Zu+CSk5RuOfqAMHUadKLB6I82ZoDoH31bJ ywXA== 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=iDwWHAy3IjBc/2Uo1TKY+D/Mf9Qi0bWoJjuNneOZt4A=; b=Dsw4hRkK58n2PLZV0gHW8OsreYAXBdWUvLPmHy7GS+P94BOLegCpORSoWnmMn4u2FS AgIfPrUd33ssaq2pCiTSMIMQt++toVdHRCwyzd076DoCsmmSq0gAK5B9a7joDJlTiy+h csFTc3ZFkjMBerIrHFqcHIf1lP3rfSn8Tuz7kjYokY0MsVdPvueMd4DnKOizbr9eHEOV 9qL5STV5jKLgVuBrvCp3ni/qoillBirZ7NBn0Oaci8LbjYSUEhCfaMopEtUmLazR0PvL vwZ0eEEhu6D+TN4slDjP4S6hpZKSuyOvEh5897JDFTEP9dcWrh7jrddixmYg4XO12lpO D6cA== 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 d65si1148733pga.307.2018.04.11.12.17.30; Wed, 11 Apr 2018 12:18:07 -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 S935253AbeDKTGi (ORCPT + 99 others); Wed, 11 Apr 2018 15:06:38 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40858 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935242AbeDKTGg (ORCPT ); Wed, 11 Apr 2018 15:06:36 -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 A8D73D51; Wed, 11 Apr 2018 19:06:35 +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.9 305/310] team: move dev_mc_sync after master_upper_dev_link in team_port_add Date: Wed, 11 Apr 2018 20:37:24 +0200 Message-Id: <20180411183635.669723522@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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.9-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 @@ -1203,11 +1203,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", @@ -1247,6 +1242,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); @@ -1271,8 +1271,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: