Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp172069rdb; Thu, 5 Oct 2023 22:47:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGA0Jo/NQyBQMWO5RXQe+l868OYpQZgX6aIASAYVdPgWJ+JaKwpQdGb0XeeBkJutmgQ5Ia9 X-Received: by 2002:a05:6a00:2d8c:b0:692:cede:c902 with SMTP id fb12-20020a056a002d8c00b00692cedec902mr7401608pfb.9.1696571271909; Thu, 05 Oct 2023 22:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696571271; cv=none; d=google.com; s=arc-20160816; b=WzIip6JvHmZptbP9k/lrmRfbGqvn0626Hag5KwhRnkgKUTWW5l14rcZ0bKSCD/sXgZ REXhnXGCMor6WPxVIk4igCE//iuDX43YFsQtpy/XGi3iJaUx9jmNOGII3X30wy2qbr56 dr4Hl8jPKtE+QU9mlilh0sdsSJqL6xnEGOWJ40bytZFnpsmraNku+ggYflReQZktohKo Wra1DbOmhdWODOZDvsN7dsmzkXIyFooLkFLVD/pVUw4KBgeWYmuQ63v7xote+by2uRC0 nmgCZ8hg2puDCWRW0krSFB6vEnZNUyPKHc5YsUEm/cvrfhnK4dpWQtYu40tuDOkNOI0e /syw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=TfDqof1d0+jratQc4b12PrFXipqb5oMgmlMdGGA3IRI=; fh=gn802DtIGLtzeoFoqARwtat61fFzXTYw6YHtYKHSkQ4=; b=HW3LupsxeHFVqOFl0108JNF27t+1DVIUBmFPpeX4peeSNvd0IOzAlMinb/DshSRv7D 3KSRdj/H1txUswunN90CVkmhVOiZ5GXsosKV1y70FdC4W/o0DmgjAgPbyabN81ZXdkMb 2n6dcTf8maepW5DyG1cZAG3QdgQWhar4FBAfsIh90O5w85BDyffq+VSk44cZHm4RwFiO Qz1VCp4r4sPcZGSrLyplD9RwgysBBV9DXJ83OBqPFN3GNL4z11qRVgqoyjTW9NYIFcZp JYDxZ+Lt+5UX8FeopYlSy7cFocxQPBY59n9ODXldhHYSu6y9Jw8fatXAxCcHnq1xA8wV 2org== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id cb7-20020a056a00430700b0068ff659af62si794513pfb.106.2023.10.05.22.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 22:47:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5ECC28068E25; Thu, 5 Oct 2023 22:47:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbjJFFrg (ORCPT + 99 others); Fri, 6 Oct 2023 01:47:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230017AbjJFFrf (ORCPT ); Fri, 6 Oct 2023 01:47:35 -0400 Received: from a.mx.secunet.com (a.mx.secunet.com [62.96.220.36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 940D8B6; Thu, 5 Oct 2023 22:47:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 41DD92087D; Fri, 6 Oct 2023 07:47:31 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pHY9T4XaCd70; Fri, 6 Oct 2023 07:47:30 +0200 (CEST) Received: from mailout1.secunet.com (mailout1.secunet.com [62.96.220.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 01E5D207BB; Fri, 6 Oct 2023 07:47:30 +0200 (CEST) Received: from cas-essen-01.secunet.de (unknown [10.53.40.201]) by mailout1.secunet.com (Postfix) with ESMTP id E937280004A; Fri, 6 Oct 2023 07:47:29 +0200 (CEST) Received: from mbx-essen-02.secunet.de (10.53.40.198) by cas-essen-01.secunet.de (10.53.40.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 6 Oct 2023 07:47:29 +0200 Received: from gauss2.secunet.de (10.182.7.193) by mbx-essen-02.secunet.de (10.53.40.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Fri, 6 Oct 2023 07:47:29 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id 29F9B3182C7D; Fri, 6 Oct 2023 07:47:29 +0200 (CEST) Date: Fri, 6 Oct 2023 07:47:29 +0200 From: Steffen Klassert To: Kees Cook CC: Herbert Xu , "David S. Miller" , , "Gustavo A. R. Silva" , Nathan Chancellor , "Nick Desaulniers" , Tom Rix , , , Subject: Re: [PATCH] xfrm: Annotate struct xfrm_sec_ctx with __counted_by Message-ID: References: <20231003231828.work.527-kees@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231003231828.work.527-kees@kernel.org> X-ClientProxiedBy: cas-essen-02.secunet.de (10.53.40.202) To mbx-essen-02.secunet.de (10.53.40.198) X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 05 Oct 2023 22:47:49 -0700 (PDT) On Tue, Oct 03, 2023 at 04:18:28PM -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 xfrm_sec_ctx. > > Cc: Steffen Klassert > Cc: Herbert Xu > Cc: "David S. Miller" > 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 Applied to ipsec-next, thanks!