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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE33DC433DF for ; Thu, 15 Oct 2020 10:48:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 43DAB22250 for ; Thu, 15 Oct 2020 10:48:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="o+g8c8vm"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="JtSEW8zQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43DAB22250 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=u9SX0xmafPF5Pq/k8saQebVo/OJ95rW0wLVGZyxr+IE=; b=o+g8c8vmE+QuIvtVZVdK0yAm5 fc+t6v8SmQpbH3WVSYGra0I3+aoleEPZNbVO12aQ3ITv3Vj7rDlvSGM7LIF53u+1MYU+++eRbbXql hGqPpgV4tog2K8T1gVV41k/Ke205Sl1U+tGpqaonks3fZzZAaIFDuUe/iytDvojEBZ7mTLF+kT+el Uc+qgX8ppoXnTRBiJEaWCCngG1g5PnU96N7zhMs5CVAXk2qVBnMu/S0tXvLa/6XU2IwKtNgYQHw7m uKFw2x+GriOuRvun5LZUXTsvy74+bCznPoqiuVmu6JWfbE8j3W5aLFd/EwD/y6U3mJmUa6gmFPrVe 4urqRs3LQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT0mT-0001wC-Ep; Thu, 15 Oct 2020 10:46:45 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kT0mQ-0001vN-H4 for linux-arm-kernel@lists.infradead.org; Thu, 15 Oct 2020 10:46:43 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3891D22249; Thu, 15 Oct 2020 10:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602758801; bh=gXIQg43MQeHgyttPDjwIat1LsZBk9eNJ8oLnamDAe4Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JtSEW8zQeAAoXIYCGmu/rUB7/8ePlbg7SVQFq2CqeYaT6y2gj1SQnddzkKvwem0t/ 0dX88tzKq0gKIsGtnsNdtTX5ewy0Atl2n+mxw1onqLC1E6lBPIPxxTIWqXw7z0LSKf +1RUyqT8mBqlMrHR29XhB9/wVHoxR2w2yBjrZows= Date: Thu, 15 Oct 2020 11:46:36 +0100 From: Will Deacon To: Ard Biesheuvel Subject: Re: [PATCH] arm64: mm: account for hotplug memory when randomizing the linear region Message-ID: <20201015104636.GA5064@willie-the-truck> References: <20201014081857.3288-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201014081857.3288-1-ardb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201015_064642_675124_B1C199E4 X-CRM114-Status: GOOD ( 17.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Steven Price , Robin Murphy , linux-arm-kernel@lists.infradead.org, Anshuman Khandual 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 Wed, Oct 14, 2020 at 10:18:57AM +0200, Ard Biesheuvel wrote: > As a hardening measure, we currently randomize the placement of > physical memory inside the linear region when KASLR is in effect. > Since the random offset at which to place the available physical > memory inside the linear region is chosen early at boot, it is > based on the memblock description of memory, which does not cover > hotplug memory. The consequence of this is that the randomization > offset may be chosen such that any hotplugged memory located above > memblock_end_of_DRAM() that appears later is pushed off the end of > the linear region, where it cannot be accessed. > > So let's limit this randomization of the linear region to ensure > that this can no longer happen, by using the CPU's addressable PA > range instead. As it is guaranteed that no hotpluggable memory will > appear that falls outside of that range, we can safely put this PA > range sized window anywhere in the linear region. > > Cc: Anshuman Khandual > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Steven Price > Cc: Robin Murphy > Signed-off-by: Ard Biesheuvel > --- > Related to discussion here: > https://lore.kernel.org/linux-arm-kernel/1600332402-30123-1-git-send-email-anshuman.khandual@arm.com/ Anshuman, can you fold this one into your series, please? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel