Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2703239pxj; Mon, 31 May 2021 08:38:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNS0bUzpLqXwrl0a45lzpvD+617fqZ+FDE0KC9Yck6+xC+U3ONasSHU0v83g1yDOCuyam/ X-Received: by 2002:a50:ff15:: with SMTP id a21mr26136346edu.103.1622475490051; Mon, 31 May 2021 08:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475490; cv=none; d=google.com; s=arc-20160816; b=0oz+TsJnp4KD9FVHgAmB5tLZ5VDSCBCI72wGsoBMUwm4MKIwYFk3fDBYRAUvh1mWkW 7W5p/UpQStli5zmkN7CKpG02nDFA6JHjKV6Fb89YjSj1ZvFT3/BqhbKeG35LSoFDaVRv lRjKKEUqUbMhNnNmbSE654eKz3gVTnD5lqxCa9i974apw6ZYurbfMh/Th7QO11sfxFKy sOsaq4VEDtSq3XyfvxO9IbxJPsZuw8OOpDZLjWdDQTbYaiOxNTjrHLfIKtH7umo9Z2f1 tEkwXIkuXsUow/EyKTNckNGVTYpBHzNKl2yyO3QVWsMqdDykibuDVMwerLfmA/YyPV0T yDTQ== 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=Kpv6vb409sx6f44fhl2VVx9qqWnk1DFvL9kdN+HQlxA=; b=UXixtTxlpFC6HIivB/TtWqAvZhCJkBYUCxA+o2Sh/2gvzMUpuZF4ayMtL9MnBAdh1N gtjcOOwfKuHmpRYEJmeY31RZkgWk0YyY07SqWnFzBVoqVEqMAlKDR710lkh9wsZgzpXk 7VgLXZb7lFkJap1/LThBSngvZbGBIxH2Cgli5lXH3dznTh6Zp7yvjqz22GfyfnycTV7R 8seiqoCPdkpEjduo4FHTVRflel65R1B27wBXDqWMUcvxzABEWksPS6XPYPHry8oygJP+ FH+fYaOtj/YbrELWk/QDFJjv0Dpuz6rodimYVM9FPJO7QHvaPh1VMPgb1Xrsl3gajuH4 MQdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ls6bxQQA; 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 h11si3449468edz.24.2021.05.31.08.37.48; Mon, 31 May 2021 08:38:10 -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=ls6bxQQA; 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 S234739AbhEaPgI (ORCPT + 99 others); Mon, 31 May 2021 11:36:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:47636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233628AbhEaOV1 (ORCPT ); Mon, 31 May 2021 10:21:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DDDC5619BF; Mon, 31 May 2021 13:44:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468669; bh=GUODRiWqg3MYqh5/IXV3dxuuz9MocSFhxMZE7BRIUzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ls6bxQQAELxclarN6Ae2G/Ojv/rIKv51g5fyKpDSYq3XM+6FurVA+S/OJMKBMPrtZ Ug2CVX6nYXwWmLqEmfXVQJIuMneB4n05c7Mni4f8yi3b6pty4lqk2KNyAe4Xc7aARg Uvb275JdBBRUFM8ZMgJop5BnA0qlinRJZYOUcdfI= 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.4 079/177] net: dsa: mt7530: fix VLAN traffic leaks Date: Mon, 31 May 2021 15:13:56 +0200 Message-Id: <20210531130650.634211903@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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 @@ -809,14 +809,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.