Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2277533rdb; Tue, 3 Oct 2023 16:37:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYDEX1/ShnvuSvTePGAhzN4vslt6IRm+fEpMVGjdXGJO793KfW6cTcryhYU14RC/8edIeh X-Received: by 2002:a25:dfce:0:b0:d7a:d716:233c with SMTP id w197-20020a25dfce000000b00d7ad716233cmr697164ybg.41.1696376233654; Tue, 03 Oct 2023 16:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696376233; cv=none; d=google.com; s=arc-20160816; b=FVcGeN+tA9mndYatgAZjzYp8BHLFbD8oD3Gs35NXuEkPUIOnw01pPDfOU7PklBHves gJ/hFDoMbyiJX+ZiulCKv051xIk1yGzLxlvMdaoiT/jTDJGvXgDysM3G4bt7t6dhg6Bx F+M3s9vYy2uFM9N88HflgH1bqbzNXtBgF1UHlm4mvPezNPTnWoHqf+3st/Suaty73LZh /lO7jBKzTB59wJOU6lHh0NnSgZ/T5E1cC6pREoJ4hOwfp7ezsOkP7UyET8yYvNUHn2/D iDKfBG5fkMhCfB2X3/ky/U6bwdn/oM2pnMn/NfGjacZ6kxu0m2OS8GpcV7l0bc/0T+j9 1nMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=rXpcmSID7ZLtaTvf5rXZ3Kiab+pg0kEGgpCzshH0ilU=; fh=Deue3YHMfI97ThhgJBK+eaD3UWZkmso414x8pxOIL+w=; b=MH87SCDYIggn0NUMNbbu2sYzkqxhfQWClgRx3j9Us27V2FEJVE69ftSFRrMk2QuQl0 eeyaNJoDhKlgjp5O9la6Kp1fgbgXL4a2bk5yE9xK5rWlperSf841b0ZjKsF+FwDvvph5 z3F3gvlN+f9oaCoWkTDA9lC25VF710JwwRFYBVUoXywhGyd556yttDkTWj8dOqu80PdH htQ3e8vh7NoGP8jkr4qvQSzehbdM7bAGSNJzgDquT9GBkcNPYAhd0cZaC1Ov9byixV1I e7HvFCaydcER6jhkbNngXE/nMm6NGC01H2DgZqf8O7LMF2b3GqGIhqSv8waH+obx0YfW UTRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DiN7HWwA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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. [23.128.96.34]) by mx.google.com with ESMTPS id u191-20020a6385c8000000b00573fd1b31f8si2688244pgd.704.2023.10.03.16.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 16:37:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DiN7HWwA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 12F1A80398F8; Tue, 3 Oct 2023 16:36:57 -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 S235111AbjJCXgx (ORCPT + 99 others); Tue, 3 Oct 2023 19:36:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236548AbjJCXgw (ORCPT ); Tue, 3 Oct 2023 19:36:52 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD6D9C9 for ; Tue, 3 Oct 2023 16:36:48 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB364C433C7; Tue, 3 Oct 2023 23:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696376208; bh=JlZKAr1MFKBroi3aiHBMj5smlSqGSHEUMHgaW1Fzld8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DiN7HWwAoSs3mW7jauE9BquMRpLtWxVfnh3UZ1Gmq/bSNNiaADXEwsx9ISXyApOJq 755IQVY6QgI/evjKL0Erfk3cgxFNDXFgudhzlY2Rw0+tza8UVdHvnnjMtJe7bdqYQ/ nfSye/GQRDLY1E76J/Ww/DPrFFu6SyS9jqEmvM0UYZB3+QEpUYD3N0N7oAkjbJL5GC /epq5QcS5FagvTZ6n9AyM25N0EPt3FYeYmIjAkmuKa4W5k40qgzqTSjJHDEcUMksOK i/MfI0/aqH8oTp4/3oD3t1bUxq4lLp6GkZapoFRsGZkHsAEN/x9t/yULq7gy+cx06f e/Tc5dvZRC7xg== Message-ID: <164ebd58-2ee3-bff1-48e7-fe430fb27e6b@kernel.org> Date: Tue, 3 Oct 2023 17:36:47 -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_res_table_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: <20231003231818.work.883-kees@kernel.org> From: David Ahern In-Reply-To: <20231003231818.work.883-kees@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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]); Tue, 03 Oct 2023 16:36:57 -0700 (PDT) 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_notifier_res_table_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