Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2799868rdb; Wed, 4 Oct 2023 11:46:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8hJWpnWAIiQCgvXzBpH1pAQRDrnOP16tsoFlG/341UNz5ZipPLXBUddrrlXOfenXIBBke X-Received: by 2002:a17:903:41c4:b0:1c6:294c:f89c with SMTP id u4-20020a17090341c400b001c6294cf89cmr3526806ple.63.1696445174338; Wed, 04 Oct 2023 11:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445174; cv=none; d=google.com; s=arc-20160816; b=cec4etg3uLq1L9LYhOkZmqInvq6q1dG6+cPaRpd6+SvPJ3pqRW39RF9Hc2ah9Hl245 2SKT7RBcz6L7dboaZKc09o304FsByKhVX4Ba5NUUOoDGOpPnk1JPlEiMXSyfk7P2yhfe OO10wpfsnAenLdow1nQdy26ufiX7kqN1gmu/Df3g0IZK45s/b5WBGoL8CqbY0pejBG+r iFFJx/WC6XyVausQUjbkwrmqyR0cvNOcKZdTER8jjyqQlhgmw8C1yPq7KhBFZTI2LQs5 ur0Cic/xOigl4h0e/R1jqaomdoGXvbzRsCqlA3q7E8/81bOlXS2rjqWz7AEeFSADBNTS yF1w== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rtgKBK+tAmWesUCSXg1pEjaq0IdMi0uzA5V8iwCKa8c=; fh=RgzhTivKJ3eeI+QQGzrMSA+HOn1gr6CEe5P4TwpuhA0=; b=l+sEAX0SV7yQC/3RMYTsxNCwxkEcmRkQbF6GayRoIOJ1+1+gkK4mDba7HN6Atg5odd AML13v9Eav8/4D7erosY2h1qvMUHpfsZam27Me8Hcetn+zCIUlkZQfEaEYq/ue6Kf5a5 WYjOA/DMbgk8D5A9miUYPwjdkqDAmGC4NESQFQqm9V5kqFZ/xDdK/XtbZwgZpKn0eklZ gfBbtLVh9mdho2cZJFsg+RLD4PBshWsTfqxZebOvHBRgzSbmCMDTihJQYtpc0/t9AmPy 2+Q8iFU2k1aJmRmTM+E+iXVl1ECbm0WYFnM03Wo2x+7BH+US4O6EA8Chn4EAD+sTmhs+ PAdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gvBSh8+d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s8-20020a170902ea0800b001bbd639dff9si4763077plg.467.2023.10.04.11.46.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:46:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gvBSh8+d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 7EA138093D72; Wed, 4 Oct 2023 11:45:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244576AbjJDSpC (ORCPT + 99 others); Wed, 4 Oct 2023 14:45:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244257AbjJDSpA (ORCPT ); Wed, 4 Oct 2023 14:45:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 743D9C0; Wed, 4 Oct 2023 11:44:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7350DC433C7; Wed, 4 Oct 2023 18:44:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445096; bh=kMdSleGdDSkNeDkcR8NOit5Qc/BamxxI/xtLxfY4N7s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gvBSh8+d3KS95DWmkQU5S8YVC+ZI3O+PTcEZCLG5tn4cSI9ZlVpg/QlKMjI9qr1af W/UIXvUhfw+qogfjtZypafxFlHUHilDm0Jk9S6tOmvbdgEG2EtDZy8qCoi9EssSORJ lLrVyegmxtJ4obzy8MGR356nWOdRGcW6RPquak3X4gpUNMJPKv8PbWtAn7az9kaiXU UZKnNiQTI/M3AHuyEwqiFIt8+NTFJuf/+oYTlIsbdkxq/lX4ddY/HTZT9PZgk7sRX3 PX5Zn8tGWJ5JUQXTvUOuJPQuMmDdxZQrjivfV1eFnCqWUh8HiCeOiYu7cDPZpff5vI b4bzATHFmvxYw== Date: Wed, 4 Oct 2023 21:44:52 +0300 From: Leon Romanovsky To: Justin Stitt Cc: Kees Cook , Saeed Mahameed , "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: <20231004184452.GF51282@unreal> References: <20231003231718.work.679-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:45:30 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 03, 2023 at 04:21:05PM -0700, Justin Stitt wrote: > On Tue, Oct 3, 2023 at 4:17 PM 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 > > --- > > drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > Thanks, Reviewed-by: Leon Romanovsky