From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F6F7C46CA1 for ; Mon, 18 Sep 2023 08:28:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240744AbjIRI2V (ORCPT ); Mon, 18 Sep 2023 04:28:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240690AbjIRI17 (ORCPT ); Mon, 18 Sep 2023 04:27:59 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EBF291; Mon, 18 Sep 2023 01:27:51 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0FBA066072F2; Mon, 18 Sep 2023 09:27:49 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695025670; bh=q/RnJBMS2Bz4pnBRsyhr6AWWkU5fbRLwj6dY2Bv2yJ4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ckplOVZBWtmlF6AlYh711gtncHl8omA0WfIROZXv1zTmLyRfS7OCcC7Jg7tRHp1ls TofKCZZYZKOZMMe97UmjvxcUxA7/tLUk9wtOWRgiaILyqDeRwa5yUAFzOvfSL5qfRI QEZQlKkIuoGJ3EBqFwT7cXGswWtaAXWzzSNLejr7sdEGK5rCbpyFJDxyKHlrwJj0F1 a2tFQ5YGVOuM7NyLmA7CfOqVxnJ3RaNnOPoR+k8+krJl6urqU3wHhhLehm76WN1q7F NI/XdpDD2VVPJXMTb/eChBEE2b6MQiDPtr7LXSOJb/qkzX1idE/gqcHiqZTD4seIi8 fwgJ+BgXjamsg== Message-ID: <77d5d2d2-5939-e43c-9f1c-d115274ad1ef@collabora.com> Date: Mon, 18 Sep 2023 10:27:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH] leds: mt6370: Annotate struct mt6370_priv with __counted_by Content-Language: en-US To: Kees Cook , Pavel Machek Cc: Lee Jones , Matthias Brugger , Alice Chen , Jacek Anaszewski , ChiYuan Huang , ChiaEn Wu , kernel test robot , linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-hardening@vger.kernel.org References: <20230915201051.never.429-kees@kernel.org> From: AngeloGioacchino Del Regno In-Reply-To: <20230915201051.never.429-kees@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Il 15/09/23 22:10, Kees Cook ha scritto: > 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 mt6370_priv. > > [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > Cc: Pavel Machek > Cc: Lee Jones > Cc: Matthias Brugger > Cc: AngeloGioacchino Del Regno > Cc: Alice Chen > Cc: Jacek Anaszewski > Cc: ChiYuan Huang > Cc: ChiaEn Wu > Cc: kernel test robot > Cc: linux-leds@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-mediatek@lists.infradead.org > Signed-off-by: Kees Cook Reviewed-by: AngeloGioacchino Del Regno