Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2535484yba; Mon, 6 May 2019 07:38:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWTiutFEEUM/E8VsTVolLOoIrJaXm9cqfXThm4bb+n6iK8DxVwsct8zXnuO+ahyRuL1M8B X-Received: by 2002:a17:902:2924:: with SMTP id g33mr32552959plb.26.1557153532633; Mon, 06 May 2019 07:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557153532; cv=none; d=google.com; s=arc-20160816; b=Q/4rQwUZlcIG0hcyB3uzkV1gj0nHRGI49pV3PyPHp/G5z84tY5plIGeIGMaWyg9AeP hGKu0Kof02UfbL/D/d/DQliyGXENNckxDBXCBXac/o/lVcxI894U6NNSIZ/AFQWfj5FZ U8ksaSM0h9B6FuISl5nvo7cGrcYnbjM7x6dDYoAr6Yr5t0sj4QR+Shsw532BXIQFwgdG 51XkDv2VccbH2MZcMZY6BTa6rUt/+GAUIMIpJDqSFHJ3md0cd4tDtJ0uj64zCXNhGj7O tX4Jnnd3ocd8k9WGvrY+/Wqo/bhZqAUhBSLp3TifQ7OKWKXfWatJ6RlESc0Dx4sG9+UB 9XZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nYV5huVxCdJgzyy73WrhrrTSQv4hCCtvR8ZTNkk9w2s=; b=Zzzvc/R8Ibpn0t51yqanqVAaMmWbpYiCR7TlT83yUkaB7qlYbby37C8jkEMKRB2Dlu FtpdRCi0QC9A4rYP1wCE04xrDSsnMsBalgUVBH0xiIVnFMzaAt0z4BEAmr0ZUC4pAfTT k5L1gWoJ8y8i9ETU3BDcCl/sb0mxjoXjWBWWOR3/NlRgIONbiDMnqFITC5ApWvSl9ixZ fry1/GneM9lp4IXo+OeDX20o9Q1KqNKJB3QUuxYlh9fEDXmYD+aZYGHNVZsolnKNOA5R /vQ5r2R1hHgIop2JeXL6HcoPeCy9oQVzo1lpjWnLci9rjJeLE+HJcaxt3b/u3MoTpc0y 2TlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yRol1mUw; 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 1si16130544pls.222.2019.05.06.07.38.37; Mon, 06 May 2019 07:38:52 -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; dkim=pass header.i=@kernel.org header.s=default header.b=yRol1mUw; 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 S1727256AbfEFOgu (ORCPT + 99 others); Mon, 6 May 2019 10:36:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:57292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727224AbfEFOgt (ORCPT ); Mon, 6 May 2019 10:36:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 234B9204EC; Mon, 6 May 2019 14:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153408; bh=eF1lfFAie7NE02O+U2JLXR5vKUcczpO4HqZ2NCz0ivM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yRol1mUwJLbYI48gUWoIAdfUmEnSPPsNXW7nASOwaT+FOKzK3wErvP8MpcCZhrod/ YGbiItBuzRX9AM3W5JXMEzbHgb7+IoBdppLmf7+lqWsW98GAE1k959mZeis1hAVrLF SC9z+cZC4Td8zMLfNo/oc/TXBp4SWv/FZbabsJd4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roi Dayan , Or Gerlitz , Saeed Mahameed , "Sasha Levin (Microsoft)" Subject: [PATCH 5.0 047/122] net/mlx5: E-Switch, Protect from invalid memory access in offload fdb table Date: Mon, 6 May 2019 16:31:45 +0200 Message-Id: <20190506143059.165325989@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 5c1d260ed10cf08dd7a0299c103ad0a3f9a9f7a1 ] The esw offloads structures share a union with the legacy mode structs. Reset the offloads struct to zero in init to protect from null assumptions made by the legacy mode code. Signed-off-by: Roi Dayan Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin (Microsoft) --- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index d4e6fe5b9300..ce5766a26baa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -1402,6 +1402,7 @@ int esw_offloads_init(struct mlx5_eswitch *esw, int nvports) { int err; + memset(&esw->fdb_table.offloads, 0, sizeof(struct offloads_fdb)); mutex_init(&esw->fdb_table.offloads.fdb_prio_lock); err = esw_create_offloads_fdb_tables(esw, nvports); -- 2.20.1