Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp6074580rdb; Mon, 18 Sep 2023 03:28:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4LSENt2hNHrim58ktc+st1sIN+9/onWZBkpkithrhbqop95uEC+RPTtONaSHsDkiyut1O X-Received: by 2002:a17:903:44b:b0:1c0:cbaf:6930 with SMTP id iw11-20020a170903044b00b001c0cbaf6930mr7922122plb.54.1695032935296; Mon, 18 Sep 2023 03:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695032935; cv=none; d=google.com; s=arc-20160816; b=cLOYo+QR+zOUNQRTVvuHWFB7bUdzuhNmrzY7MfKKk656SsA3BDSrYsKMx11ylGOUsZ YdDVlXqGsaakjkGXZ4UqPU5eTYJwTbBnWOkVxUtanFtCvFI6PdCdjX4QMRflyvoNyOfo 9TwJfrGoPOxcKAw4tTIYscm67fyNPAkVSNM5mjmG6b8VxgBR7UNvv5twHH9Imi84Jy36 lKsZ2g2vlmkMOt6U2H+yMiXJ8ocHTbHUgP372Qk3ocqm/9YL1noR7rkaeMC/0ff4m1DP eW6DgAfm0wVIlFz1PyCW/yPMofn4dLoFTHMQnnv7v1HYSnDMajvzlDX06zPY68tiNOKY tPBA== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=27jMKhFWq5ruOOkWx1y1/gOso/Zj65Hopy8kp0wRAy8=; fh=EbHJju26d9JIjHMh/2r4v8A+1i69/ecM7Q7fsABP2rc=; b=baBVEDZNZqjuvbO/kuKNYodCLrlxeedo4dPbIsk6NcshbvudTxvZD6d+PQwSA9Xwoh oROZ46mcX5dTDY6HGbynT2I6qWj4X7xABhnVSpwa4IdYllq8WYl6JaIrkhjZDxoqOvdX U/RNfXOCQy3WsQ450ppIDSNeNe8LSdaiyMf5luOIZwKcb35mn7uvgHUlPoJagLMRFILQ pXlJ+sqIbSopsBlVnSngI+DQ+rCMrXOW2ZJ8ITbq5OjKKxkJYpreZal6ZVZp7DOimxzp f2sQj2q+FMv7DfBBCmacEzujA5/EJ+8/TAVCbLoAJLTbJdlMxxY379pgQk0SpqhMPthS utUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MCpXWpON; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id m7-20020a170902db0700b001bb3bcd05bbsi7973470plx.471.2023.09.18.03.28.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 03:28:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=MCpXWpON; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 783D081F3475; Mon, 18 Sep 2023 01:28:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238800AbjIRI2W (ORCPT + 99 others); Mon, 18 Sep 2023 04:28:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240693AbjIRI17 (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 244DF119; 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) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id CD4F266072EE; Mon, 18 Sep 2023 09:27:48 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695025669; bh=0xZU9+BT1Lhziqj2peG186RnTVEcjM4RamFlwc9caGc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MCpXWpONy0BtkabzIDxKDZdBpclb4KkEO/vjdiqSRSgOHkRqs5VNUf+0IHZZbqH0M /ThenAX6gk3cHjl8PWjJi5TIhQ079I4XgooYj4242puGEmZxRvwUmWhHZFE5AmJpXr ORZtBymDne4IYqhlQ1R/QdHE2t9Qit3dqRD439i4wlJBAaQlKb1zLcxp39+PckL9YB nu94/qKIEKzqSCn9Zm41J7txDh35e7GHSSVVn/g8k1VBoiJz/3ZGD2dUffJGlf9w51 JLkn7z1KFZppAxaC/KIp9MGLZ1MjWHILB5YhduiOD1DFe1dAAdyqZUv8QLvf/+TRvy 8Tlz+R9eNyBJQ== Message-ID: Date: Mon, 18 Sep 2023 10:27:45 +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: mt6360: Annotate struct mt6360_priv with __counted_by To: Kees Cook , Pavel Machek Cc: Lee Jones , Matthias Brugger , Gene Chen , Jacek Anaszewski , Andy Shevchenko , 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: <20230915201020.never.433-kees@kernel.org> Content-Language: en-US From: AngeloGioacchino Del Regno In-Reply-To: <20230915201020.never.433-kees@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 18 Sep 2023 01:28:52 -0700 (PDT) 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 mt6360_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: Gene Chen > Cc: Jacek Anaszewski > Cc: Andy Shevchenko > 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