Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp534506rdg; Thu, 12 Oct 2023 12:49:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFghMoiTXsRjyN2bchLIX5kQIORSvACSxjd/cpzcynPpjRyEmOa2ZxNRyvSYpfuEnjLIfA5 X-Received: by 2002:a17:903:447:b0:1c9:dff1:6de7 with SMTP id iw7-20020a170903044700b001c9dff16de7mr3619027plb.7.1697140187843; Thu, 12 Oct 2023 12:49:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697140187; cv=none; d=google.com; s=arc-20160816; b=uCTifVu9pNokHNCvqfIrnABDDPQX0nXdaszHZnGsBstp2jFPdpfYQVrzD+VjuuAeBa jhSRhWHfjP9tJgQePwP/tTgLdtJ7dAzOoPMAvFoSGldgl3mMMKiuZTQso0zuPL+wkFV8 X9Zex9acBVF+e62hkUHfg/nd6IYE5iu0xE3SWtUs3+PKLc7XUnHwDhNMD7wooA+BOTwU 3O76XRDJVj8zJpZXYFDgFyJwUd4p39Lo2B44Cl5VsP1hVZhjMNRdbcZGL8GHX9TbiUGw OCRXQa7eJdwQSo4G2EZBT2B+ohsLPdBe4tGJjst2UJopOHwmaZEWnQ/jGe5M3gmT8kPN miDg== 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=JX7ZU2XiXw++bn1D18ecdFGhzCKpId5/KU2GQQr0DK0=; fh=jVxJYofHTXhHvy0ZGtBuLFS8X3F1FmMY0c2Fp7VOn9o=; b=b3ylli/fIA2MsbWw/Dx1lNx+71I2Xkt5CIAnLBTNDHPbcNIw+mYsjRLomkGM3QvJBO pFhSZgRjqnJpqO7zrmOQOa2szKdJCI2B3wq1jeczuQ4W/lgZpo5C+vbt33IrQeOp8SKC gsTlhVOWEq9BgRJAcops7YFlQqEW8OOsQAczUtki33IxQEt4joffwfomhNjp3PbF+rl9 fjQy1uHLMkCVQi1OjxB15H3cuRoFKmQduRbdAsnVX1fBVKoDaG4ioz/310RtTvf1rR8P xX/7YJzOS4lIoSg9tisUi2SZKzjtWPWIVBNA2oC/f6hrJ1ShO/meOYMgmKED5r7FaM6A SAXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DQ2sVY7r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b12-20020a170902d50c00b001c752da513asi3047886plg.405.2023.10.12.12.49.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 12:49:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DQ2sVY7r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id DB18B829768D; Thu, 12 Oct 2023 12:49:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442975AbjJLTtf (ORCPT + 99 others); Thu, 12 Oct 2023 15:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442643AbjJLTtG (ORCPT ); Thu, 12 Oct 2023 15:49:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A522CF5; Thu, 12 Oct 2023 12:48:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BDAFC433C7; Thu, 12 Oct 2023 19:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697140135; bh=JX7ZU2XiXw++bn1D18ecdFGhzCKpId5/KU2GQQr0DK0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DQ2sVY7rwTATyZWtaVainC2Bi+Ou4hsHYEsc7mupLgOr+D2qk2qc3Xyn+hIKdeRSH uuNWJ0zxxbPNCe8LcIseklrUXJxmQ9XxrbKU48N8IStxCCNKohuqcHpCz3el+wQ3Kc W7w51TyVK4XYmvm7fymS4fpCVsiAkI2ajl4cp8higGFiC/E5tYpTn6HXWLbmgFFajA wvNY7Er4QIiDVFT+qUJFtt6ljilipKRUK8fN32NnqJZAz6QAkp83gJ0cVPsaF0T1B8 PMQfo/vL6tCfoQnOuGRsYc6eZn/br6naXFoQbH0a2huyGYC4OzNqMAXUaP9+pVi+b1 EiWc1593XwgaQ== Date: Thu, 12 Oct 2023 12:48:54 -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_flow_handle with __counted_by Message-ID: References: <20231003231730.work.166-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20231003231730.work.166-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 12 Oct 2023 12:49:45 -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_flow_handle. > >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.