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 9306FC433F5 for ; Thu, 5 May 2022 18:04:32 +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=BiSTsw33md896r4YTueD82sLzzwC1+GeNaXHrdWkjvs=; b=LHJ47LZwJeNxFm AqvEltxsj+TSlxPT+0Vpr18TTm9t0OeIeLEA9fqkrp3Z3Hw04byyViuUZEbgT0xlB9KX5ji9gCIxf 8SPsnbSe/cruzbKfqjyMKsU6q9gm4EblmKAJjwahbJNSkbxYSkEbJd7hSnPdrf3OQA4n5lYCXbsi3 aKeQPU4hVHHLFUH4sjRrR9VxS5hA6/j4ENeID2RaIbWOKVYviFVqzJK6qPoaHsGUHUr5K6why8W3r iLvR2lqeSh4x1oy1+rEehx3pgOkjhC889oW6XozVCQe5iWo8KtNSHyefpLp580+Gywki5oYp2+J0n J9uU7Gd56DRH3HyERlLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmfot-00HDML-70; Thu, 05 May 2022 18:03:19 +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 1nmfoq-00HDLb-4I for linux-arm-kernel@lists.infradead.org; Thu, 05 May 2022 18:03:17 +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 BDD20106F; Thu, 5 May 2022 11:03:14 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.38.147]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A0C0E3FA31; Thu, 5 May 2022 11:03:12 -0700 (PDT) Date: Thu, 5 May 2022 19:03:08 +0100 From: Mark Rutland To: Sami Tolvanen Cc: LKML , Kees Cook , Josh Poimboeuf , Peter Zijlstra , X86 ML , Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel , llvm@lists.linux.dev Subject: Re: [RFC PATCH 10/21] treewide: Drop function_nocfi Message-ID: References: <20220429203644.2868448-1-samitolvanen@google.com> <20220429203644.2868448-11-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220505_110316_252955_D746E54D X-CRM114-Status: GOOD ( 18.34 ) 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 Thu, May 05, 2022 at 09:51:39AM -0700, Sami Tolvanen wrote: > On Thu, May 5, 2022 at 9:30 AM Mark Rutland wrote: > > I also believe that in most cases we can drop the __nocfi annotation on callers > > now that we can mark the called assembly function with SYM_TYPED_FUNC_START(). > > Good point, thanks for pointing that out. I'll add these to the next > version of the series. Also, I *think* we can drop __nocfi from __init, and always check calls to functions in .init.text. IIUC we made those __nocfi because it leads to section mismatches, and dangling entries in the jump tables after we discarded the init text, neither of which should be a problem with kCFI. Unfortuantely, that appears to be masking some existing type mismatches; e.g. psci_dt_init() blows up because it uses the wrong type for its callees (a mismatched `const`). With that fixed up, arm64 boots fine. > > There' a latent bug here with the existing CFI scheme, since > > `kpti_install_ng_mappings` isn't marked with __nocfi, and should explode when > > calling `idmap_kpti_install_ng_mappings` via the idmap. > > The CONFIG_UNMAP_KERNEL_AT_EL0 version of kpti_install_ng_mappings is > marked __nocfi Ah, so it is. Sorry for the noise! > > There' a latent bug here with the existing CFI scheme, since > > `machine_kexec` isn't marked with __nocfi, and should explode when calling > > `cpu_soft_restart` via the idmap. > > But it's indeed missing from this one. Cool; I'll prep a patch that fixes just this, then. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel