Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2960539pxt; Mon, 9 Aug 2021 13:09:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5XLQE/Us9LF/gy9feyw9gFyOgDG2rTy1nbIfPFvCJlk+eGu6O+lL3boMUWeK+KY8zawcO X-Received: by 2002:a05:6402:35c7:: with SMTP id z7mr21675edc.85.1628539762303; Mon, 09 Aug 2021 13:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628539762; cv=none; d=google.com; s=arc-20160816; b=zaWPxzaD3If0OwWmkWVsa/fLefpgou7B5/0OoX9cTVdPas08x5WTlDsjcU3tqIybcf 5afuqexCgEcNuM6YnvlwEEmzAHmTCdrZM6yeJxZGh6tlPeb2rswBsh4EOYsyTODkhoSs upCjCo2cT3Nf1fHVo1iXZzua2ZQeFvGhZGBGt/nFT7G7uFHmkCfjvMxkueL3lnxHWwKQ zhpjHac19w+AQWsjg0E4PBGZeULzqyB7oWHFzPb8B1tQOIureefYCF0tC6hOdaDUrvAL MwpB/yrKs6tejYvTq7Y53ydqrAsoCpcrdDBCrwJDQiLp7SBQo6S/D59gpm98z4CbSqhd 9Zqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1pYqGax3qSXnNTucika/IABBjCeQ22ESG6fuRy15h2s=; b=w7G77tGi5L6okEsyWYv7eBJOFJrPb+WJAfyQ4J09j06HbuZjcRHbWmjYx63iMY+v5I 5bm2O6mLr8+Mi0OBFQAC3eWJ2ALz54O6FjtsoZHQ37dJczSw+ls81HTrf1b03tl4t1n0 OXQhoCDejAzO3ZN85lhOC1I+Fu5gVOBQMODFwh0hOH9fnBDfPGIJyCEfD9P1DWwcecZM CnaLEQYbTdaRvz51LV1j2psscBBPjLPfcvDTer2hw+/vxjBIMGBOlpy8kqh7YlXWZH1y GiX0pHqgqdo39SXy+neOBsLsUZyJNwHyQlpIK0RhECc+VP+3bWaSTgR5PIajBnM+Zdwm vuYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=S0HfUGCC; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si5085641edw.170.2021.08.09.13.08.58; Mon, 09 Aug 2021 13:09:22 -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=@messagingengine.com header.s=fm3 header.b=S0HfUGCC; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235513AbhHIPQv (ORCPT + 99 others); Mon, 9 Aug 2021 11:16:51 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:53429 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233058AbhHIPQv (ORCPT ); Mon, 9 Aug 2021 11:16:51 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 0BD8E580E2C; Mon, 9 Aug 2021 11:16:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 09 Aug 2021 11:16:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=1pYqGa x3qSXnNTucika/IABBjCeQ22ESG6fuRy15h2s=; b=S0HfUGCCFMNYaWu6zatInR 6cI4qb55LV3zeq/ewdvnVH056olR0BWLNBPwfe7UJwTpogsD3fD2/cQL/wEAp3cl nxKthDD4fyRdv+2IV6Qoo7dhdBFzgeh2gqTKAso7T1Evb9SnOsFh2B4zYhOUprJP EO5VljpUmoAzyggHCkHjUDOSMr5LbQw2X+cN5RdswfF6B30UnI03EJSQI+SwijQ/ 0x2Iryu5RFRJmkRZnyY1vFtTJg0yVcmKoPeCwCPPe+pHtKqp6dDUMdTjCaqRnZWY FW/KwPpuZZm17f/6Rg3yrjlX9ksK1UhH8mdDL05f+6cvCMZOoEtuLDu5lYq9d2gw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrjeejgdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtrodttddtvdenucfhrhhomhepkfguohcuufgt hhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrthhtvg hrnhepgfejvefhvdegiedukeetudevgeeujeefffeffeetkeekueeuheejudeltdejuedu necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihguoh hstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Aug 2021 11:16:27 -0400 (EDT) Date: Mon, 9 Aug 2021 18:16:23 +0300 From: Ido Schimmel To: Vladimir Oltean Cc: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Andrew Lunn , Florian Fainelli , Vivien Didelot , Vladimir Oltean , Vadym Kochan , Taras Chornyi , Saeed Mahameed , Leon Romanovsky , Jiri Pirko , Ido Schimmel , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Grygorii Strashko , Julian Wiedmann , Karsten Graul , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Jianbo Liu , Vlad Buslov , Bjarni Jonasson , Vignesh Raghavendra , Tobias Waldekranz , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH net] net: switchdev: zero-initialize struct switchdev_notifier_fdb_info emitted by drivers towards the bridge Message-ID: References: <20210809131152.509092-1-vladimir.oltean@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210809131152.509092-1-vladimir.oltean@nxp.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 09, 2021 at 04:11:52PM +0300, Vladimir Oltean wrote: > The blamed commit a new field to struct switchdev_notifier_fdb_info, but > did not make sure that all call paths set it to something valid. For > example, a switchdev driver may emit a SWITCHDEV_FDB_ADD_TO_BRIDGE > notifier, and since the 'is_local' flag is not set, it contains junk > from the stack, so the bridge might interpret those notifications as > being for local FDB entries when that was not intended. > > To avoid that now and in the future, zero-initialize all > switchdev_notifier_fdb_info structures created by drivers such that all > newly added fields to not need to touch drivers again. > > Fixes: 2c4eca3ef716 ("net: bridge: switchdev: include local flag in FDB notifications") > Reported-by: Ido Schimmel > Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Thanks