From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7362810E8 for ; Tue, 17 May 2022 08:56:35 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E5D5D1063; Tue, 17 May 2022 01:47:43 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.4.124]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E2EE3F73D; Tue, 17 May 2022 01:47:41 -0700 (PDT) Date: Tue, 17 May 2022 09:47:37 +0100 From: Mark Rutland To: Sami Tolvanen Cc: linux-kernel@vger.kernel.org, Kees Cook , Josh Poimboeuf , Peter Zijlstra , x86@kernel.org, Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [RFC PATCH v2 08/21] psci: Fix the function type for psci_initcall_t Message-ID: References: <20220513202159.1550547-1-samitolvanen@google.com> <20220513202159.1550547-9-samitolvanen@google.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220513202159.1550547-9-samitolvanen@google.com> On Fri, May 13, 2022 at 01:21:46PM -0700, Sami Tolvanen wrote: > Functions called through a psci_initcall_t pointer all have > non-const arguments. Fix the type definition to avoid tripping > indirect call checks with CFI_CLANG. > > Reported-by: Mark Rutland > Signed-off-by: Sami Tolvanen I'd prefer that we spread the `const` to each of the implementations rather than dropping it from the type. I have a local patch for that I can send out shortly. Thanks, Mark. > --- > drivers/firmware/psci/psci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c > index cfb448eabdaa..6554bf4b8c99 100644 > --- a/drivers/firmware/psci/psci.c > +++ b/drivers/firmware/psci/psci.c > @@ -521,7 +521,7 @@ static int __init psci_probe(void) > return 0; > } > > -typedef int (*psci_initcall_t)(const struct device_node *); > +typedef int (*psci_initcall_t)(struct device_node *); > > /* > * PSCI init function for PSCI versions >=0.2 > -- > 2.36.0.550.gb090851708-goog > 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE1F5C433F5 for ; Tue, 17 May 2022 08:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W/TkyNxBcTpJ+xAq8zmJTNiK8j+b0cVLwHgJYyXjxvM=; b=t7XDTyvqaomFfQ oqsQEj1idk5AtEZVnf6Epyv+flIbOk2+mGJTtKxm2OU7SEfTJHmgAWdY95B2ZaAA8mBSjQPRHAH6o fEEKgkJVL00urpGl59+MbiKsAfsTJ4erWBfhst/UetRYWjESGp/c0Q4wiSfbdR5oee437GLJxiZqm DGyoFIY34jdaQ62bfgEVlry6en4HofNIcwiYUSxIWOHEJ6SbcUNIsOke1r0vctxVsJ2hUfDdMYgjZ rK6LvEJyADHBt63W60rDHZMsVH1WiD8eMOPdOiFZY7FvCJVrYLAHCxrf5s7rbopa2UVA1Xl7O31Ju EjnsCiAy6JablZgb8Mxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqsrw-00CYZT-OI; Tue, 17 May 2022 08:47:52 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqsrt-00CYX4-Vs for linux-arm-kernel@lists.infradead.org; Tue, 17 May 2022 08:47:51 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E5D5D1063; Tue, 17 May 2022 01:47:43 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.4.124]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E2EE3F73D; Tue, 17 May 2022 01:47:41 -0700 (PDT) Date: Tue, 17 May 2022 09:47:37 +0100 From: Mark Rutland To: Sami Tolvanen Cc: linux-kernel@vger.kernel.org, Kees Cook , Josh Poimboeuf , Peter Zijlstra , x86@kernel.org, Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [RFC PATCH v2 08/21] psci: Fix the function type for psci_initcall_t Message-ID: References: <20220513202159.1550547-1-samitolvanen@google.com> <20220513202159.1550547-9-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220513202159.1550547-9-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220517_014750_104968_B3C176A0 X-CRM114-Status: GOOD ( 16.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 13, 2022 at 01:21:46PM -0700, Sami Tolvanen wrote: > Functions called through a psci_initcall_t pointer all have > non-const arguments. Fix the type definition to avoid tripping > indirect call checks with CFI_CLANG. > > Reported-by: Mark Rutland > Signed-off-by: Sami Tolvanen I'd prefer that we spread the `const` to each of the implementations rather than dropping it from the type. I have a local patch for that I can send out shortly. Thanks, Mark. > --- > drivers/firmware/psci/psci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c > index cfb448eabdaa..6554bf4b8c99 100644 > --- a/drivers/firmware/psci/psci.c > +++ b/drivers/firmware/psci/psci.c > @@ -521,7 +521,7 @@ static int __init psci_probe(void) > return 0; > } > > -typedef int (*psci_initcall_t)(const struct device_node *); > +typedef int (*psci_initcall_t)(struct device_node *); > > /* > * PSCI init function for PSCI versions >=0.2 > -- > 2.36.0.550.gb090851708-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel