Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1021727rdh; Mon, 25 Sep 2023 00:11:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0IGmv13jdmxulcywtZqdEGPCRFA++64z6/UEFXC3NwA54HfAf5QLmWGSXGs71rQEchsB6 X-Received: by 2002:a17:90b:4a88:b0:274:9be9:7ee3 with SMTP id lp8-20020a17090b4a8800b002749be97ee3mr9391579pjb.8.1695625894815; Mon, 25 Sep 2023 00:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695625894; cv=none; d=google.com; s=arc-20160816; b=agmq8nE5ls09ne8TtRvUMzJfZtB2UpEtGcTrMF88Fe/qtzoHPTKRslt7RBO/bS49TT VlepkBxg95wPGf26eVi2cWBOd51mNRKWqKz7VXoQaV+3tWo9ooa4Ef/3UPOnB7fdD6rs ENRMaha3Aym8EV9JlVeuaZVgM/v20WPj4xm9VZit2UeKx1RI6E1kROJuih/CYzVAdBEr xoGNXWSBVYTTQjhVKq303Zdo6aihYeO5e9ooYc4DwzOzXoX5PVBv8JL8SI8RqxxJTSOb SF784yk9QgbGGUq7citH4O3jmW0mkGXFOlsRZYxvcCA5r9YKd3Owv7MPL1jsn6u2l1tB p7IA== 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 :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=4kjOlAHI7Q2m8M0vGQzyNOrCYe3gx/LwO4x9ureCVxA=; fh=1omJBCbvSH1HZdjNgccdfewejVtOFvyfKAfr3v9NeW4=; b=ALBEq1QqZRjMPntsLUnSvPa0zakodtkFjZB7u4xuyzaVwgkZRsmHM1Cntumx2N9YuO J8bTPntKDQ1dV1aW7DbKlCYi1lnK8XiXFNUiDVuzN6BIgG/YA9icRQ/5YDZJrPF/aHpe NnF/9zhsRO7/5p6B8PPgQQjOV9whSaAxeMcjvsjS8GKLrdwSOqxosq2CSh0pBD0zoacy 0B2Yh2yfLKKojGzXRNl8XxR0MJdye12JPyrk8Lp+y1ajeQXUn8NiRhYzyGN5pSUNXLKQ 5PQkb52iyBHQhfZAgqreZ9kXxcLLDDowa4jPmrhLl2RQclyGC1ALvelyP9NHCmNNOnuP 79Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DMVQlaEf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id x1-20020a17090ab00100b0026d40e6a819si11274301pjq.157.2023.09.25.00.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 00:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DMVQlaEf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 3C7788087FF7; Mon, 25 Sep 2023 00:03:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231816AbjIYHDy (ORCPT + 99 others); Mon, 25 Sep 2023 03:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232347AbjIYHDj (ORCPT ); Mon, 25 Sep 2023 03:03:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FCB41AD; Mon, 25 Sep 2023 00:03:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D16FC433C8; Mon, 25 Sep 2023 07:03:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695625412; bh=bmAGW7IJt2ztTo1zPNp1/mpQS4/bkBknIARLsF7U394=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DMVQlaEf67tOHftNFThuKdXgyAdtD0mbBEB7T2XUg9CW8RtZ+qst2VlYRKN+qAAqJ 76PIUfdXIBbH/l/TIrP2QcdDHXCp0kEZA8gk4qUGnMi6gq/OOcHZDqy1PQYyFDbl2V ZqXsSIcDeaKBdRFnbHWxvsOvjwMsQktd5Nm+o9AIudLwKUTSmr5e/FFI5uUthLQIaP oe9waQLEXCWd5t/rbEiTcIBTEMHZxxj1YyIAWrw+4yQfGa1MDbxhO4QoB7uSfWLaaY mTqKUE+uCmO9DJxkRA8pyn5QH0F8g5abc+2wpDgp6TbUPZftUrry5rzIgbqd/fPwug VThTcFwX2JDww== Message-ID: <0981d982-45db-d069-e26b-801b67ad1ae3@kernel.org> Date: Mon, 25 Sep 2023 09:03:29 +0200 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] libata: Annotate struct ata_cpr_log with __counted_by Content-Language: en-US To: Kees Cook Cc: linux-ide@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org References: <20230922175210.work.239-kees@kernel.org> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20230922175210.work.239-kees@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 00:03:54 -0700 (PDT) On 2023/09/22 19:52, 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 checking 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 ata_cpr_log. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Damien Le Moal > Cc: linux-ide@vger.kernel.org > Signed-off-by: Kees Cook Applied to for-6.7. Thanks ! -- Damien Le Moal Western Digital Research