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 66ADEC77B61 for ; Fri, 28 Apr 2023 10:42:05 +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=xUpSlNAwDi3S20tNPNhcrvjUZCVyauw5+WGaZ8tY2ek=; b=kjCyroACBMGd06 J/S7DauBDqq2XuzDLwgmLP85h+hp6hqvyxW6JEwdwtuuPM30SIaQdeyjvofCvNQeXhilrsjB2oPjN Z6dKvC5o1SIy4O+lDzCjWjnYUN1TgF49wbFC7Q5tpPjxmCB/P60pYPjMifDk3hA1GcGl9FC2HIz+i HinCy7y6a19PGljZYpxOiSF1BXiL2bq6AALf2iFaU17Pt5otsyIN0JYxshCrgAOiXz0Ic4udBebfx Udyw1VjJCdvLSDQ+jHfBvKhkgIKmBYa+5cEEkPxGkem1N8c/E0OEvbsLs4mnk9PwOHaGJMQjxNtma Zs1sHxslNb67uxZ2XM5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1psLXX-008rJj-05; Fri, 28 Apr 2023 10:41:23 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1psLXT-008rH8-0R for linux-arm-kernel@lists.infradead.org; Fri, 28 Apr 2023 10:41:20 +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 5016FC14; Fri, 28 Apr 2023 03:42:01 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.21.9]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DED143F64C; Fri, 28 Apr 2023 03:41:15 -0700 (PDT) Date: Fri, 28 Apr 2023 11:41:13 +0100 From: Mark Rutland To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Marc Zyngier , Ryan Roberts , Anshuman Khandual , Kees Cook Subject: Re: [PATCH v3 02/60] arm64: mm: Take potential load offset into account when KASLR is off Message-ID: References: <20230307140522.2311461-1-ardb@kernel.org> <20230307140522.2311461-3-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230307140522.2311461-3-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230428_034119_223273_414580B0 X-CRM114-Status: GOOD ( 20.13 ) 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 Tue, Mar 07, 2023 at 03:04:24PM +0100, Ard Biesheuvel wrote: > We enable CONFIG_RELOCATABLE even when CONFIG_RANDOMIZE_BASE is > disabled, and this permits the loader (i.e., EFI) to place the kernel > anywhere in physical memory as long as the base address is 64k aligned. > > This means that the 'KASLR' case described in the header that defines > the size of the statically allocated page tables could take effect even > when CONFIG_RANDMIZE_BASE=n. So check for CONFIG_RELOCATABLE instead. Could we pleqase update the comment to describe that? As of this commit it'll be left describing a KASLR-specific case, and it'd be good to have it mention the case described in this commit message. Thanks, Mark. > > Signed-off-by: Ard Biesheuvel > --- > arch/arm64/include/asm/kernel-pgtable.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/kernel-pgtable.h b/arch/arm64/include/asm/kernel-pgtable.h > index fcd14197756f0619..4d13c73171e1e360 100644 > --- a/arch/arm64/include/asm/kernel-pgtable.h > +++ b/arch/arm64/include/asm/kernel-pgtable.h > @@ -53,7 +53,7 @@ > * address is just pushed over a boundary and the start address isn't). > */ > > -#ifdef CONFIG_RANDOMIZE_BASE > +#ifdef CONFIG_RELOCATABLE > #define EARLY_KASLR (1) > #else > #define EARLY_KASLR (0) > -- > 2.39.2 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel