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 8980B3FB09; Tue, 3 Oct 2023 23:36:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63DD1C433C7; Tue, 3 Oct 2023 23:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696376184; bh=fI3/kyfV7jlL4X9PoxBOPNL9WBh1qBNy9eYiQsgGgSQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bfCgu8UOFEbSxlRRSBcr6Mo/IaVwxwXRv3F6KcN3YXgtqFctyCt8UPAnhgJi1CbnP f9RSK5kVCxsirJsJZ78u+sU1E9d6gOgm5EFsw23N6C1rJ3dF8JDoyMXiTFbZOVlRqC uS/SdSy5xvVbDAWyjv02/5ugtze9VRcerFiVvPB+6LGus4GabR/miD+S/72wC0eCqj eStOVGxKzXbVhuT+S40ihgC7vPWe6WADyRQkpt8uPXbQ6vVANpViX6qAs49dAAKoV3 WKdyTrP7kKwAh55Phml/AgN9hBa9RPCCQ0ra1CzxH8aDE7eXk0nEAfClfrcOrsT374 VzxhT4m1C6tSQ== Message-ID: Date: Tue, 3 Oct 2023 17:36:22 -0600 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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_res_table with __counted_by Content-Language: en-US To: Kees Cook Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@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 References: <20231003231813.work.042-kees@kernel.org> From: David Ahern In-Reply-To: <20231003231813.work.042-kees@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 10/3/23 5:18 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_res_table. > > Cc: David Ahern > Cc: "David S. Miller" > Cc: Eric Dumazet > Cc: Jakub Kicinski > Cc: Paolo Abeni > Cc: netdev@vger.kernel.org > 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