Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2660524pxj; Mon, 31 May 2021 07:39:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHpkSGors9nhkZwKbuhwYxmax+MVkSeeUYJe/X77oE+LBNdEP1tLYT0OSaJ5vVnyWQzDzM X-Received: by 2002:a05:6e02:1d82:: with SMTP id h2mr16646634ila.78.1622471941669; Mon, 31 May 2021 07:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471941; cv=none; d=google.com; s=arc-20160816; b=z25VZHR8keLGkjAG7RcH0xjVumGyKtX09qTtQrbKgIsHFNmpQn35gyb5IiFmQHFzXV UStzJvhYPG8Of7/fsgh6dN34ocfQT5xQWacCRNbvVypdu+oEYfTC4bhMDspaIv9m6nN8 9QQlSz9Q9KvEjnjSWyYzpQpPHRh/rl1lWSe55/joTLdv0GagMw+qin9JVTF/TRgQ3GDd CMOVY7QMrOgnVfN83SnGgMT61J+CB/gL3wuB2mWgfSXF/+l7fhCUnhxS9nOi1WyzYEus acUGD7Nzh+Oso8EkXtcTb2U/FTr1KyVf55Uzf9jcBDPyflc7lG0AMO9MbhB9nyY6ro6O 6nwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tiXigdooO6V80ExHkU0s20Ur382Nr3tb8Bl9YDxY4K4=; b=Te7NF+Sci2Y4aXZe1vtvIsfzEzSK3HWyE+gmL9Q+A1JNz1SJE66z/e9bt8sAn16gGQ FczXws58TX/sWh/uRDUHfs/mwYZDBrnzae2PZblCY2hva49QdOZ4bgQkxADOtORYwY+Q tO1+aHUU/2IpQ5uBp1MSvA/JkoB88NxetPmhDZpSAZoZEVspT9/8IMtRilzg0+nEmGXM n/uAdOCaedm5oelIs5Lm5nro6Xes9UWVXJSJjxM+ZOymbfN5wXg1YgOvjbH/dAuMI6PI MlTbfr98uLE3euQhYbV3egPmiSrS64d/txTuudZIapbpyYAmfvsGxgwGDNAlQ7XN3BRd 43xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A7iq2VmT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si15520953jaj.50.2021.05.31.07.38.48; Mon, 31 May 2021 07:39:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A7iq2VmT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234108AbhEaOjU (ORCPT + 99 others); Mon, 31 May 2021 10:39:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:32912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232754AbhEaN4v (ORCPT ); Mon, 31 May 2021 09:56:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C86D6613F6; Mon, 31 May 2021 13:34:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468092; bh=nSzoqu+NssTticyvB1cXi2h4UsL4r0RVT9Va9UZIwcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A7iq2VmTbfRB7YEvU8D8yAKeXR6Fb9RHF9XJiAjdsCpvM6NsuiOQS9P+OzXKRU77U nLhFhYN+r9bUSHJZymmlTITnSADkz8HmOXOIXACh8qhwX3BqylsqqErCpAxv05gYpX 1r73rFg2QwG80E8uKQq9ieO7J8STEXh0re4dyCWQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, DENG Qingfang , Florian Fainelli , "David S. Miller" Subject: [PATCH 5.10 112/252] net: dsa: mt7530: fix VLAN traffic leaks Date: Mon, 31 May 2021 15:12:57 +0200 Message-Id: <20210531130701.777457173@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: DENG Qingfang commit 474a2ddaa192777522a7499784f1d60691cd831a upstream. PCR_MATRIX field was set to all 1's when VLAN filtering is enabled, but was not reset when it is disabled, which may cause traffic leaks: ip link add br0 type bridge vlan_filtering 1 ip link add br1 type bridge vlan_filtering 1 ip link set swp0 master br0 ip link set swp1 master br1 ip link set br0 type bridge vlan_filtering 0 ip link set br1 type bridge vlan_filtering 0 # traffic in br0 and br1 will start leaking to each other As port_bridge_{add,del} have set up PCR_MATRIX properly, remove the PCR_MATRIX write from mt7530_port_set_vlan_aware. Fixes: 83163f7dca56 ("net: dsa: mediatek: add VLAN support for MT7530") Signed-off-by: DENG Qingfang Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/mt7530.c | 8 -------- 1 file changed, 8 deletions(-) --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -1128,14 +1128,6 @@ mt7530_port_set_vlan_aware(struct dsa_sw { struct mt7530_priv *priv = ds->priv; - /* The real fabric path would be decided on the membership in the - * entry of VLAN table. PCR_MATRIX set up here with ALL_MEMBERS - * means potential VLAN can be consisting of certain subset of all - * ports. - */ - mt7530_rmw(priv, MT7530_PCR_P(port), - PCR_MATRIX_MASK, PCR_MATRIX(MT7530_ALL_MEMBERS)); - /* Trapped into security mode allows packet forwarding through VLAN * table lookup. CPU port is set to fallback mode to let untagged * frames pass through.