Received: by 10.192.165.156 with SMTP id m28csp29770imm; Tue, 10 Apr 2018 15:44:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx483+u1S+2/k2/A+AWh9O4ZRMwijaC0Fv/S2rAKgRzvp9BVkC56how+Qm+rDD2XEytyWIqRV X-Received: by 10.98.58.129 with SMTP id v1mr1834671pfj.231.1523400264545; Tue, 10 Apr 2018 15:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523400264; cv=none; d=google.com; s=arc-20160816; b=0o6fySO0ES1ZYnVkecwbTn2UvM0jmYuLYF+P14frOxu1jP4mAKETH9exH5BXZi2BkK gPAH65RSegn4h4bwSrhElumaC9CUBrnBzUu20LUIfElhJys6db0PE623yo/eO2QJH4Q8 hR7Zl7LXlNjAueF5UnT7CFBc+SXWIoKe05XTHy3zq5Gy5Ebf6G9FGR37+ww1VY4Zh5/C UVbdzQ1VwPl3bxaQK9S0YytG64ZHgrgVVglpI6PBB6aYenCHnnTGPVptRJgnMzdGHUhq inev/H9iBJU0bk3bbip63LAFLZi0XDtPp7rGkjro06ut6qDFKnNsHGUAh8VKTY4X10xh hhnw== 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=EWaEHRRn+5Cq+iw+hFf/jyTBN1nmuUPm40mcdtVXlRg=; b=VyC/DooSL/PAhZZeIBwhvMorXhbGqoZbpAtC2KStXsuhNlqOHrtpJFMYb6c8EOOQB8 mvzG2/g9OO3Nxcphm0gZzAAVC8EA5R2fb19GlsQHHqWRTs3gYGVk9w4vVM804xMmFsUi lhYIUcRs3wzctjocjZ4QqRdE26OihvX09+5KyaoHdhHSCLEIy8Rpo10KNDlPpaZc2yCW +/u1PbeEkuZwe9ZwYoicEkJHMzp9Hk90CVJxN89Ipni6nO6fm6HlexBiaa1G38oQz2CJ TMBCMzAzs90QPWknivFR6iXKOWdRQDEokMwl/xENphRilnc/E/kg1CiNcu6Vl3/1wlIZ H/7A== 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 q77si2439283pgq.297.2018.04.10.15.43.47; Tue, 10 Apr 2018 15:44:24 -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 S932780AbeDJWk3 (ORCPT + 99 others); Tue, 10 Apr 2018 18:40:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46790 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932736AbeDJWk0 (ORCPT ); Tue, 10 Apr 2018 18:40:26 -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 BB4DEDE8; Tue, 10 Apr 2018 22:40:25 +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.14 136/138] team: move dev_mc_sync after master_upper_dev_link in team_port_add Date: Wed, 11 Apr 2018 00:25:26 +0200 Message-Id: <20180410212918.078087566@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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.14-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: