Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1924772rwr; Fri, 28 Apr 2023 03:56:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6AlbTcGqG20h4W8gZvbcfBcfddjAQ2B1TJL5tHCKnJZ0fK7IeGPG0dWDUoo+e2ORitanOY X-Received: by 2002:a17:90a:930b:b0:247:1c17:77eb with SMTP id p11-20020a17090a930b00b002471c1777ebmr4807445pjo.27.1682679361350; Fri, 28 Apr 2023 03:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682679361; cv=none; d=google.com; s=arc-20160816; b=syfWQCuPuShpeM/B6uHh1Xf2ZOOtb2ov7prrplVyL29qMhsbeYrC5d0DFgDn/wNM0V NZLygUwh8JGfNGubajBEIQSMNe/rlJh8wGIORH3WA6YBNIpbewphP2ujaQae/hdhvREo QqqC8M46dNIA24nAEocNEdFAdvD3dDt3x+nK2IaNcp1wx+moA5WaDAvwBO+W8Mio5veF uXgVMi+PnoX9N1Nhhkq8xXdEtE9Yk2P5WoPZQHUe7NyxmcaeoWJE7GY6viuTySLyKIui MgvzXfp06dlwCG2+0lDYDTNHn5vdnRE+pqdWNgNYVHobhk3te950CbRUQGXM6yU7wAYN wcJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=aBUz0VWCkivqOJvqMdeF/V+FJZ944iS/0STeEIlExJ0=; b=rSijWxaXfOsFRSG2I7WlBYDgLkI4HEEceX5+bFbQ5SoNfh5NaQqVqInDHmqCg6baRX mAV08kY+fjU/KKhYMfa9wi6IrHmihLa5gmscxAq6WZxkKIy3wZASqO0PI8zPW22K46zx Z0JwtSHGa214Kqz+WhqDlSQ9mSCpNFOGHfRH/stqJgwz7SbcuLjnLn9ershiVWo2KpJC OdY0CS2Q+p1OE/S0krXyjFSrmdFRgLofoB0XJyoK6H1lS1lOLaZsdML3M9+DJdz2nynb nxRGURqf1ywQPZLNf63Ey9TUgaS7yyE01VgG+tcqX+5RrrF1iV8fFwnSqNAWh/Skn/s9 QXgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp6-20020a17090b4a8600b002470e893981si2152083pjb.79.2023.04.28.03.55.47; Fri, 28 Apr 2023 03:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230226AbjD1KlW (ORCPT + 99 others); Fri, 28 Apr 2023 06:41:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjD1KlT (ORCPT ); Fri, 28 Apr 2023 06:41:19 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 783BFFF for ; Fri, 28 Apr 2023 03:41:17 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230307140522.2311461-3-ardb@kernel.org> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > >