Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2625754pxj; Mon, 31 May 2021 06:52:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+13//Igi5Zvp/hWiNcj0u25lelkULsKdspok1VoM5vLsby3LJ+VPt1MWYuKRpI5R7B1Pm X-Received: by 2002:a6b:e501:: with SMTP id y1mr3875401ioc.115.1622469140357; Mon, 31 May 2021 06:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622469140; cv=none; d=google.com; s=arc-20160816; b=r3eWngoZZqf1Zk5cH10ewBOSztP6XcrSeUhgUiVj93IQWcNrfeOqXA2YT65bHDbm3G MZmBsOQM8MoWuVCEKgv4gDHUGD0ef88qvjIg+WmH70VZkyLXX82VaxgQwYE28cGMRLzP ASJ/EgYr+X1RE9YNdavG+tAhN48B33Jn98GDWM3yzvw0S5ft2Rz9XXyfoHfNP/RPlRfn HrCBVplPpxAC8cNs+txyufSYi4/YRtEERzftFHFTzFLzYTnTKiy0HJjeXSEB2kQVnkTJ pNdxuM3J9MfUJGTYFctfyfakIU7YzkbXRi93QG/o6alm+8gZyVjXQk3YZijlTU9va+fw PTXw== 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=OQqdwWIN4NTjTRu68mqn9V7bn/eDXR2w8tQ7Y1vIuJk=; b=Cum0Z1+u8ibv1u618Jt5dzJsrNpTEslNrFHvyrrARorZL8EpTM5+eoo39CIQ/Lm85t Li33Xrmc218c1QX1kVxTqnC6U2/gVnCik38AxTnJix4WE7xOaSPl7DIkVuPrLaW42gEV C4ygi+iZPLIoQZaukhAiL5RDSQVGT7TtmCB7nzHczwTYijhi08QQFdsVPBZD2o4LHryw qC9NYdVkBgkyc6VGd6qu5OQDdSZFjq7kkuMFftySPFp5OlQM+ttGQS1iOeSLlQhhcT42 rpCfzJmnnv2o0OUipccsHIDY+qRSX3+eerLICVPHGZhHzqJpaJBymgt1RR9zHHMMXcox ievA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="GfO/gHab"; 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 h5si12323736iol.44.2021.05.31.06.52.07; Mon, 31 May 2021 06:52:20 -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="GfO/gHab"; 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 S232570AbhEaNvy (ORCPT + 99 others); Mon, 31 May 2021 09:51:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:39134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232102AbhEaNfZ (ORCPT ); Mon, 31 May 2021 09:35:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0224E6144A; Mon, 31 May 2021 13:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467523; bh=t38r1m1yqrG19lywPpcm2PM0Dbu7AjPD3TxcAUQw+5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GfO/gHabSabHKrGRgJd4ge/n228VaREZTPLpggEIvwicy+6VAmv0TGw4hpicjlBMy SnkPJG9hEJBfHAUgEJ20D+MnTVWzKq09rfCPEknlTzmgEZM/cV8X4CmZ5i529UKqD+ RiMAIb+FxY3EtFiMrZFwM3KATJ3UR2GpfQlI4nUg= 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 4.19 070/116] net: dsa: mt7530: fix VLAN traffic leaks Date: Mon, 31 May 2021 15:14:06 +0200 Message-Id: <20210531130642.520516690@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130640.131924542@linuxfoundation.org> References: <20210531130640.131924542@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 @@ -851,14 +851,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.