Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp534245rdg; Thu, 12 Oct 2023 12:49:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/k2t05ldVfP2dxozhJBA4ajedxcsf0OMXLK2UIhY3jenjhhdjhzqOsvQnEqt/kAllMrlp X-Received: by 2002:a17:902:c950:b0:1c9:d667:4e4a with SMTP id i16-20020a170902c95000b001c9d6674e4amr4509628pla.69.1697140153632; Thu, 12 Oct 2023 12:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697140153; cv=none; d=google.com; s=arc-20160816; b=AXJWfaTKnQ7YWg3RtooNt5mBDQ3AY0boZQN7aFANv58uZNLu/tGLNo+Ugdsf4X/lbi kv9JyD886fa17e/cRinqNyeMoSdP4mwEkw07lVG/3KUVq2leCeJSKhzHVCWah2fe1YjS nyt9XfyLsQs7SWZkyZN6ZjIBOWDYGRiVFOhJDwUXGgKXOqs4jyaQF18jxcAJupvwyHDZ 2iOlCYWx3C5rbiyF1IH4+8Ji6LTWga7ce25MPHVg15N4cP3qVn30JvOTpgrUcxPgYUT+ oIIQN9HydJwal647E03t/6lJS7Lbd1eEnZW8iI8yLqpVfoFx23OYkag9WqJkRNAxURTX MBeQ== 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=xKxtPIbjmhojr5P8UlRXEZjXsWNlqy3DYQ9BpEu6EeM=; fh=jVxJYofHTXhHvy0ZGtBuLFS8X3F1FmMY0c2Fp7VOn9o=; b=eC7gjjLhIcEgaLu1sqnEm8ItU69dLCIweuGH2QdEiyXdsHaMlR2UKh5cQvsgxzfCcE 9nDdACO8kHiQAtrvloKDP37xpycr1suqXLb7fLaCBZbRqBXWebmYZwmZNveDnAn2snUb ZctRO1fdUu97sajzaorCacUpn3z70BUfTf9tcHzAmP/PKeq5NbQQEgHiqFoE8cFX+2Bn y/8WvgWeZph+iSp0OpCFk9C7b1cyZCCZh0WLTgKZvXgimRsuIBPIJ0vfJjKM5TiOIaWI grtYmAmg1+Olzy/GEOB8llsI7Dtiw1I/rquawfYHkb4TeVg60pQPPNeGNhdohXv+GFPz q/oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sdgp7WDK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i16-20020a17090332d000b001bc8a9f5e52si3052364plr.135.2023.10.12.12.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:49:13 -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=@kernel.org header.s=k20201202 header.b=sdgp7WDK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id AE242826EB9A; Thu, 12 Oct 2023 12:49:10 -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 S1442763AbjJLTsu (ORCPT + 99 others); Thu, 12 Oct 2023 15:48:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442540AbjJLTsj (ORCPT ); Thu, 12 Oct 2023 15:48:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED1C7199B; Thu, 12 Oct 2023 12:48:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F438C433C7; Thu, 12 Oct 2023 19:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697140094; bh=xKxtPIbjmhojr5P8UlRXEZjXsWNlqy3DYQ9BpEu6EeM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sdgp7WDKUJOHj9qRddUYHur95feMlemPaULF34kusLfglTtXdjntyDVO8IyTUOmdo Vl3aXOa+VQwgnzNoBj3oJ65LFLXkm8mAdIWk3sjN+akB31QZLwfS73HpYQl0BwfgD2 y09BWLWJLvn2GsJs5xDcOXyMyHe/KMibo/Rl/T8G0f5x6VpSLtjIdeV7tRygf19IzV w987XPBsnHeeM2UvkY/bdWzatG92r7UB76loWOmeCQ7aUaBBnKOA/TA5/i9BGvDMcY A9MA0ctXdNnR4zTjXQ6hg/k/zrYjBrwSNOYFSl7knpFgra3oCCWYASf/gWsjIWU+xX et4lo44WRYUqA== Date: Thu, 12 Oct 2023 12:48:13 -0700 From: Saeed Mahameed To: Kees Cook Cc: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, "Gustavo A. R. Silva" , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] net/mlx5: Annotate struct mlx5_fc_bulk with __counted_by Message-ID: References: <20231003231718.work.679-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20231003231718.work.679-kees@kernel.org> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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]); Thu, 12 Oct 2023 12:49:11 -0700 (PDT) On 03 Oct 16:17, Kees Cook wrote: >Prepare for the coming implementation by GCC and Clang of the __counted_by >attribute. Flexible array members annotated with __counted_by can have >their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for >array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family >functions). > >As found with Coccinelle[1], add __counted_by for struct mlx5_fc_bulk. > >Cc: Saeed Mahameed >Cc: Leon Romanovsky >Cc: "David S. Miller" >Cc: Eric Dumazet >Cc: Jakub Kicinski >Cc: Paolo Abeni >Cc: netdev@vger.kernel.org >Cc: linux-rdma@vger.kernel.org >Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] >Signed-off-by: Kees Cook Applied to net-next-mlx5.