Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp98134rdb; Mon, 18 Sep 2023 09:10:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdVCjRDUMvzHqsIa//p5drRuh58lWPBMI7q/afAXmPJmdeEKqQTtDGAd28vsCLdream2sv X-Received: by 2002:a05:6a20:3951:b0:137:c971:6a0c with SMTP id r17-20020a056a20395100b00137c9716a0cmr69777pzg.31.1695053415792; Mon, 18 Sep 2023 09:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695053415; cv=none; d=google.com; s=arc-20160816; b=zkVk6rUU8TC9AuY/osYz8pBjyWglAXJwYNinFaNjGyRqcUZ9dDgHskb2YNjj3Nq3yu BJTziSYs0VI7zfs5w8CxyQC8w3LP8VPQjiY92kTMAtfXRQYLsoMwf78jQDfW4+9Kbqnr QauC1isBkPDZtG5ULg/G83qKmRHM5UcFAzJQnFrCG3hswxBilX4BSK+qzn0T7gMFtDaP u2e5jQZnFgsrXfGoMhSVWrQD+a4m4btMH97MombdkSS0nfYw0h22JfvWe/KsBne8611m FKPScOaHp0E+FpKrmBSETI0IsT8iFvTusL3FwHvwEH8KQv0gj4/P2sLvEN/ypYCdbEMK ieqA== 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:feedback-id :dkim-signature; bh=YTcyWiGsDcH3hDR+6efIJUv0XVuW7F54zGUEX+HekeE=; fh=PMR0vsAlPQdsLsVjXGSFXNv96tA5ClycP7tD9AZpk0I=; b=Srs+es61Ko8u6xddR/01t73sid/hWgfUFSHFU09xuvz6eUs75HbPVJdZpY1SnbzEKy eJoEenSKHW6RQbQH8D5EScorsfytv8sXVCSq02GmUHkY2glBWJYyTY3gRPgrbOSy/0iI 5RTYqe0dpmElGecylPO2+g+GBkgj3X3JkssQtGY9HKv8EktVRcvym6hXqWsy4EcuXJJW PogTVHMr5IhF39Ag+lzVT3LEmRkFUcKlbqKMDDn34hVmjMShH283EP8rABJgb9DrgMvi 9UQFnrrXiyumFJI4z44wFt0heyHPhh/HvDO0DkRcXAQB6hJWP2cE6MoXSYQokjT7kWn8 ZPkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XeFZt4k3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h124-20020a636c82000000b00565e6a5b065si3315837pgc.107.2023.09.18.09.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 09:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XeFZt4k3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5A511802418F; Mon, 18 Sep 2023 00:32:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240420AbjIRHcT (ORCPT + 99 others); Mon, 18 Sep 2023 03:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240330AbjIRHbn (ORCPT ); Mon, 18 Sep 2023 03:31:43 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33E5A197; Mon, 18 Sep 2023 00:31:28 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9D4C65C0152; Mon, 18 Sep 2023 03:31:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 18 Sep 2023 03:31:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1695022287; x=1695108687; bh=YTcyWiGsDcH3h DR+6efIJUv0XVuW7F54zGUEX+HekeE=; b=XeFZt4k3yxxKIxg7+9pecr1XxHAdB uoruOhrzc1asSfE4JphaRxshTnvuTSond3JWHvfRLEH+nN+XJ8RaXfzE/Iz7UaNH srdBS5GfO5VonagRvQVR++8rCrm1mTGw5GHKiHjqHuuhAoKspd38YveDTbF1sE3e 41wNcJ1s3ejc2SSJgTEM8TIxmYYe2BoNu5puI2zoU0WAt2tseXa5IogAMUc3M8rZ Rs3IREi4eWiqYD4HLxyZOUF+ssc+Jo2IyZ5maOiQUjg/n/fzMaUrHiSUceCPzZhR HWpoCqbu+9c3QqOE+jba1Ce+zzJU1bDWZo7ZK6WeRR0MvrRoqXgq98qHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejjedguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkugho ucfutghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrg htthgvrhhnpedvudefveekheeugeeftddvveefgfduieefudeifefgleekheegleegjeej geeghfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hiughoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Sep 2023 03:31:26 -0400 (EDT) Date: Mon, 18 Sep 2023 10:31:23 +0300 From: Ido Schimmel To: "Gustavo A. R. Silva" Cc: Ido Schimmel , Petr Machata , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Gustavo A. R. Silva" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] mlxsw: Use size_mul() in call to struct_size() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 18 Sep 2023 00:32:30 -0700 (PDT) On Fri, Sep 15, 2023 at 01:01:23PM -0600, Gustavo A. R. Silva wrote: > If, for any reason, the open-coded arithmetic causes a wraparound, the > protection that `struct_size()` adds against potential integer overflows > is defeated. Fix this by hardening call to `struct_size()` with `size_mul()`. > > Fixes: 2285ec872d9d ("mlxsw: spectrum_acl_bloom_filter: use struct_size() in kzalloc()") > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Ido Schimmel