From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 809441D6A9; Wed, 4 Oct 2023 18:45:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MCz6fPWJ" 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> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003231730.work.166-kees@kernel.org> 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