Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4330713pxb; Tue, 26 Jan 2021 19:53:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXsS/TgrzH57/9fi2K5GIPsLkQO4hXmR4K0YukyzSgE6tXHBM4/b23Sm786O9xG/j0Mv9o X-Received: by 2002:a05:6402:215:: with SMTP id t21mr7141933edv.363.1611719607560; Tue, 26 Jan 2021 19:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611719607; cv=none; d=google.com; s=arc-20160816; b=Q2V4gVlsLri1lc0r6+Efr4oQGGKhDdzEso3Hwbg1BOSFdsvc+AXPj+bVVSC9b4QkiE CmOMnudMWM0Z+AVN2RJtWokq1WAht5+NxJl1lTe2+MY63FryAy6BAYQh2Ow/Nagkvl6V h5miBqxNNa9THT9F4K0lE55QPSoC2O20SB8rUEy8cJddSv8lGfu2vgUWuCl6Z08PRIVk WaKNn+B6+FcYWthHhujSLOq2euB0Os8+kKlfy1iRYMPlkxYvJ5E+ZLhLDiRXP9TC4cBU iNliUENB2c6QGYtELo7iCIt1nO/V3gp1Fjgf1nuKN09xGoXoqGGZtLVtFdurzagHyrBX p0SQ== 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=yy2KtcrHIDL37PXJ9N1K3tbysPnKRnXJTohnzbQekxk=; b=DHtkhuiuBbtqxK/AeFLOD5Pt6OnqL2tJuwl33eDLgwypRanmHII5rDMb27A/+jqclX kXEseoxmPus10zfw5zovVkuV6Tlm+/qdnVCwU3zxJ4h/Aq/gmENq1KFNYWX+DH8sBORJ 7Q78bVjqCfeN/2HHgNrsRwvX/5xWoZv93ClsOERp3zwd9TujIvPoRf51oOi4T7syLmZw dyRyIjkkqJgNfaNpDiOzqUrLUNABkeRnDxB974Clpsjz6tPKLIdX5pa5rBp6JJURSxzS eqxqxK9qbr+E/xzjNOR5fzcS2W59iwu5lwSr1E1LuynOdBGCZE6mJS5TPDdRsDw/avIQ reEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sLIr8pW+; 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 a8si320252edv.386.2021.01.26.19.53.03; Tue, 26 Jan 2021 19:53:27 -0800 (PST) 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=sLIr8pW+; 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 S2390184AbhAZIdo (ORCPT + 99 others); Tue, 26 Jan 2021 03:33:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:58346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728305AbhAYSnV (ORCPT ); Mon, 25 Jan 2021 13:43:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 997CE206FA; Mon, 25 Jan 2021 18:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1611600140; bh=jtw8wKPBp6rHPKRtnsL0ki0alJMiWT378Xll64O6+YA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sLIr8pW+tyI1FDaHilv9YmeiP9V5Zwf3geSpwUtW1tkeLWv0WPW36G2tRblI8wbTF BNKIzJQ5xCdds03rlijjGfn0h8pRZYq+nmemBMDhFO00gd4sewVpYw9b46U2im1CxF OMl7SSNoXv2aUWldSNl9nev80WCwpp0s52ix1KVI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rasmus Villemoes , Florian Fainelli , Tobias Waldekranz , Jakub Kicinski Subject: [PATCH 4.19 46/58] net: dsa: mv88e6xxx: also read STU state in mv88e6250_g1_vtu_getnext Date: Mon, 25 Jan 2021 19:39:47 +0100 Message-Id: <20210125183158.687957547@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210125183156.702907356@linuxfoundation.org> References: <20210125183156.702907356@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: Rasmus Villemoes commit 87fe04367d842c4d97a77303242d4dd4ac351e46 upstream. mv88e6xxx_port_vlan_join checks whether the VTU already contains an entry for the given vid (via mv88e6xxx_vtu_getnext), and if so, merely changes the relevant .member[] element and loads the updated entry into the VTU. However, at least for the mv88e6250, the on-stack struct mv88e6xxx_vtu_entry vlan never has its .state[] array explicitly initialized, neither in mv88e6xxx_port_vlan_join() nor inside the getnext implementation. So the new entry has random garbage for the STU bits, breaking VLAN filtering. When the VTU entry is initially created, those bits are all zero, and we should make sure to keep them that way when the entry is updated. Fixes: 92307069a96c (net: dsa: mv88e6xxx: Avoid VTU corruption on 6097) Signed-off-by: Rasmus Villemoes Reviewed-by: Florian Fainelli Reviewed-by: Tobias Waldekranz Tested-by: Tobias Waldekranz Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/mv88e6xxx/global1_vtu.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c +++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c @@ -357,6 +357,10 @@ int mv88e6185_g1_vtu_getnext(struct mv88 if (err) return err; + err = mv88e6185_g1_stu_data_read(chip, entry); + if (err) + return err; + /* VTU DBNum[3:0] are located in VTU Operation 3:0 * VTU DBNum[7:4] are located in VTU Operation 11:8 */