From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CF15E8FDC1 for ; Tue, 3 Oct 2023 23:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237056AbjJCXhJ (ORCPT ); Tue, 3 Oct 2023 19:37:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237350AbjJCXhF (ORCPT ); Tue, 3 Oct 2023 19:37:05 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8676FD8 for ; Tue, 3 Oct 2023 16:37:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DDE4C433C8; Tue, 3 Oct 2023 23:37:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696376221; bh=2qFD7ci96RgiVJyZ7j0nx2Ffl5SbucWr9eaZ/kne1Ow=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=aKqhO7eSDVXXXlqD8/5/qPoZcBCuGRokmV2bbWsSI+02G8FNPPO8omhm/p39IISqF k0WsZxgPnFGSUuQzjIm15UFLB9MHX+ANjeTGDl3ykrCIDc2BBHSBo6HnyOnmEHj3le SXYfhRwyQzu9ZHC0m51sAAS2O/foh0C0/kyLhIhWFbnf96Wb4V+pX63YmrVUWsAtK0 mp34Ud/3aIW9Rg7GklL79aGwLqmmpzz2THkAVUUvTyDM1NdG7Bibd7YG3H3O3NsU9N HiB6VXEQ0PW63FzBnDUbrBUFbT3pQD8KRf100jcZdOJUldHbDnOAbKvU75X6/EXwFW CqyNQa34bbKIA== Message-ID: <5af06f3c-bc84-b73d-d7f7-a1154a5a84e1@kernel.org> Date: Tue, 3 Oct 2023 17:37:00 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] nexthop: Annotate struct nh_notifier_grp_info with __counted_by Content-Language: en-US To: Kees Cook Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nathan Chancellor , Nick Desaulniers , Tom Rix , netdev@vger.kernel.org, llvm@lists.linux.dev, "Gustavo A. R. Silva" , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org References: <20231003232146.work.248-kees@kernel.org> From: David Ahern In-Reply-To: <20231003232146.work.248-kees@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/3/23 5:21 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 nh_notifier_grp_info. > > Cc: David Ahern > Cc: "David S. Miller" > Cc: Eric Dumazet > Cc: Jakub Kicinski > Cc: Paolo Abeni > Cc: Nathan Chancellor > Cc: Nick Desaulniers > Cc: Tom Rix > Cc: netdev@vger.kernel.org > Cc: llvm@lists.linux.dev > Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] > Signed-off-by: Kees Cook > --- > include/net/nexthop.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: David Ahern