Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2338840rdb; Tue, 3 Oct 2023 19:41:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHw2MYp4gszC6mZoK7cbB7F96LZaqTqTarpsAoWfKikMyYieNPkSwEPYkn7M6J1HROiTDgW X-Received: by 2002:a17:903:1c1:b0:1c7:61a1:9695 with SMTP id e1-20020a17090301c100b001c761a19695mr1461907plh.20.1696387296070; Tue, 03 Oct 2023 19:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696387296; cv=none; d=google.com; s=arc-20160816; b=JblMeHLHEFj6eLFcIZ/5dxfRhINCFiipRB4EC1oqxUrGCYNcQMsfqqtQbAjEABC3Vf J6KHOlSFOrWr8dFDAchz8cGUfHCKqw5PHXfRExR81YtvRlUamqigYKzaTyaNEieurrGG 1nh+bCbdP6uwkc61x319uJZqt/k24yna20PpRyimpHyTgyRhDyVROHuvB4s8zjoS2mGu VgYvP6WHa6GICjs+Hr4YIG4S8JX8KYHJqyQvS0La5CGZIw/XWnELBL9SSUpmyQQVt0ZY DeR0T2ivxXdk0qQnS2PjtTJLEioRoaFeh+u48Sb4oLb6AMvJqp2FjV+E++4gfQ+34/ql d2cg== 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=RMnzFEM/HY3mg370Rb837wFdlCcWzxLewPW6zxLogKM=; fh=Mjn/bCUrZNzP6bSXAkmsBYeDqIrOc8lrRYgPIqy2Nzw=; b=V1IA5wU/vTF3YZv/cRyJV+P0rai5pNJqONEl63IIsixaaY0Wz9XuV399HArt2l0heD NEsMAwWsH7KR6tlxjnzn8r0+E0tArkFKd35IxktNv35fXDePcb2W0nlyBtN5TldZPdm7 lXouSlXqcRCLiH+Ep7nmI5QVgm0bw+r7fx4pu04ApVn1yeRwSsPHKe7rQrYtTGn1MJPN eamlNIKTSYlLmp0IvptS6XZyj1bm+gNY6p1BNlEYzqpaBrnLgztZ/X3bxIHDpcX+hmVW QAUoX4PGDwc/BgSQgVFjUkERlE2wWW3X6/AxG/qrlUCfp8KDrtZaSyWKBUQpiij8pDz0 tSkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qz26RcE1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id g7-20020a170902934700b001c61923a58esi2671603plp.137.2023.10.03.19.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 19:41:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qz26RcE1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 7C26281BFAB6; Tue, 3 Oct 2023 19:41:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232579AbjJDClO (ORCPT + 99 others); Tue, 3 Oct 2023 22:41:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbjJDClO (ORCPT ); Tue, 3 Oct 2023 22:41:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9C2FAD for ; Tue, 3 Oct 2023 19:41:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00DDEC433C8; Wed, 4 Oct 2023 02:41:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696387268; bh=eVHXKXrgwrMb2F/BFyQ7m49d0FIN0HEfGgy1Zm1UBz0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=qz26RcE1sZdQJLtl/NT6WLkkSGE7ajyPE/9yXbqemnV/aPcS5BXkao/r4wk1ithlc kKmdvqMoGYuCkdvxAlAqbMkXJjVMdJD3Evz2RQkK64jKzj8a/H5ayHeA1AHrL+nUJ4 D4I/cbImn9QWsYcJCZYvtRZy3aWLIUThFdUETxZ9kI17bP9Hp3yRNLdJrXOUAQOuOR ds7kW+HQJUyONNDshPPHTicQKvgbv51QTNi81mPwHVpAGDqQ7RACbVkwTn3W6xcdGV f+id/zSpNbC+17Xm5KmIUluUpgbDn5TOfbU3DUaZaI6oZKshTWx9vALKm481QOGxct kwh3UER7CcXLw== Message-ID: <0b7640c4-e6ea-33f9-9477-78a6ddcb195c@kernel.org> Date: Tue, 3 Oct 2023 20:41:07 -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_group 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: <20231004014445.work.587-kees@kernel.org> From: David Ahern In-Reply-To: <20231004014445.work.587-kees@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Tue, 03 Oct 2023 19:41:33 -0700 (PDT) On 10/3/23 7:44 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_group. > > 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