Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2800099rdb; Wed, 4 Oct 2023 11:46:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEt41B4oHCGanlD3MDNwpnTIS4qL0phxT7lrPi2eb06puzENBTGgCdqcvcmCitMMcSN4rJ7 X-Received: by 2002:a17:902:a417:b0:1c4:4c0f:8d91 with SMTP id p23-20020a170902a41700b001c44c0f8d91mr2496976plq.69.1696445203678; Wed, 04 Oct 2023 11:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445203; cv=none; d=google.com; s=arc-20160816; b=GW5mm1wH9/wBYgLPkigQ3xJMzhYUrntAnQxDf/AffZGmmpaheMOf5wxwk1shBYk0Ud GVnNw8PtMyHczNALLk/VUuSg1q74s+bFd9rAAWZ5idqXykzrbg00VtKtgpewSZg3w3u5 AL70pgBIj4H1q9Edn7QZFuHqwBOuI3UuYJZ5KkZlVVIv5aquNvpX8dRHAj/eDjq4M6Wx jnOnGA7S5jAUw5jQwpxgp5KINRySYZrw09auAiTslMAy29o5T5XFLgiOMbUiePd2iMhn ZnQkxmDJXhPnZALfJ3v2uEHyG3JnvcKdiMmOKiJBtc82bwAZKDNX2bo4NS5GJsS2BDp4 GWbg== 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=5Xj4FwJTvQlGzhP6eU0Bmlo5hgLVvQ4eG0L5Lans1DU=; fh=ET2wCFMWMdYhlctif+YtHan1MkNyYlkbCXba5/pOcjs=; b=ZVVeFkjEsQy63OEMcphi3os56I8yu2sNPuVzPC8UoqFrdnY7i52GbNr08cfb3o4vUW MbfjWKmJZE4UCh9f48JPLuGJuXD28S2H+5KgLzAr4/qdOyBnlwmr5vrWId8aAJaLEAn1 2BP6F7GRq9MNTspNntLHjNw8eHp5AsVLOsNWo6tztylJ4VcmMQqL/erwO27VjnyjFtgI 1sJ3tlKow/y5oAGF93l0yQqKpiAlQECqj+F9v6wlH8fTxQdlEF0ucxCFc0A7ao6IP6lz yEfSxpl8rP8ExGnn+yZmDLE7E/rmtht7anVUVd4VcwVytTy9wC19bPbBZftx5EDFvi7g VBCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MCz6fPWJ; 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 h9-20020a170902f54900b001bc8a9f5e52si4660880plf.135.2023.10.04.11.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:46:43 -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=MCz6fPWJ; 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 0B6EC808E0C5; Wed, 4 Oct 2023 11:45:47 -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 S244564AbjJDSpg (ORCPT + 99 others); Wed, 4 Oct 2023 14:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244585AbjJDSpf (ORCPT ); Wed, 4 Oct 2023 14:45:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFE18AB; Wed, 4 Oct 2023 11:45:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC99AC433C7; Wed, 4 Oct 2023 18:45:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445131; bh=2imu9D3Z8TAnL2w/VZP/VIqsJlXJpUNbul4OIe8I16A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MCz6fPWJcorTD75aqEQSmwSmhDZufZ0eg12ZpmbultXKSI7554NgQ4mCitq3MiJA2 CampcKPjQwgI900hdL2SDQwM0P5xsuvug/Qc56rDAmOKqXNU7Ll5K6zaV7W+sJDqxX 6bFWjtn64KzEwOhwE7pEdVuRe72/bXFmSptgLPfIjUgBcMtCtFaq8ZL/JzVBNZRb2H BipAKufOsbSh2wKzuOIMyP+HB5iXo7oyWoQtUplFXcEmn/MIc9OvyvzXrqKqgZ+yRb ZrdmjM2/5QuvWv7zFGJbNtVV65iCdamrCgx/Yly9Wg5qwCt3OKKLZxhhsS9v+7NM4n uKp3HYdhmcYkA== Date: Wed, 4 Oct 2023 21:45:27 +0300 From: Leon Romanovsky To: Kees Cook Cc: 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_flow_handle with __counted_by Message-ID: <20231004184527.GG51282@unreal> References: <20231003231730.work.166-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003231730.work.166-kees@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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]); Wed, 04 Oct 2023 11:45:47 -0700 (PDT) On Tue, Oct 03, 2023 at 04:17:30PM -0700, 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 > --- > drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Thanks, Reviewed-by: Leon Romanovsky