Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4939627ybf; Wed, 4 Mar 2020 13:54:41 -0800 (PST) X-Google-Smtp-Source: ADFU+vtcM86Os5+A9j8e7QmUf8/ie+tejZLr832p7ieEwARgg/EbTpKV9+iqbdzUPxCFLK5a2zOq X-Received: by 2002:aca:d40c:: with SMTP id l12mr3324368oig.65.1583358881424; Wed, 04 Mar 2020 13:54:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583358881; cv=none; d=google.com; s=arc-20160816; b=KrtDNTKlL7bguSXQsivTD3BAeP+2S4pV+hOOxvNqh45t0si0N37rwnrlyIdo9kz5v5 SO6F/neoGr38WpO+wg/AnHhXHwi6DIv1OfWW39GWwYGROIo5T0Gf5jiFzJkJti/ZkA/a J+8O3g5rJrzrQiLXLvsscFzjelb+OXkhuN7eu0djm+ln4JJ/ta411fFb+Tw4rv4GWJMi T+XqQ4tvoYhMwCagQtm+wAdbMHdvMmAHbtzF1tkA5KFr2o14BdHBKt3bvogMKCF1NBMC L1fUJN9itb5abnuB+XR8+3kgcq2QnwmHICBe5v1xkUaMy+e5KUUlh9mFLB6wGydNk3mV NWwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:organization:references:in-reply-to:date:cc:to:from :message-id; bh=Zd+H00sHTKISp/Rga/INNWxLw0zkRHYUplOzMrl2VsQ=; b=pmhMAK2Dd3j+yEAkd+U8ypw9ANWULqtd7F5b5//Sqi5CQafCjLhu3mxms1s5RGwiUv h/C8DjBGjgR8u6tUGdQVB8sbM2JViA/kO8UjrFtb5hJ5bd0rsZA4wRmq9ReiHE5os7NY 0/7EubnxvlFkWttyxsbod6s1icxqeIu8VuTqYkMrSiy2cM9BvlU68Inu8BtvrNfsugHD aFQZQ7FUpqiqJIYY/j+8le6oGNLFOwSd/3WXDW+9dkgO1T/OdIY52vBttpBmvEr/azGC CXwu2YaYTmvQB9rka6e06VzvkHSjNgBiOqd7K3ay+wsVSf2X7cI258eLq+h1ubmGa5WB cH1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si1986774oth.91.2020.03.04.13.54.27; Wed, 04 Mar 2020 13:54:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388407AbgCDVxN (ORCPT + 99 others); Wed, 4 Mar 2020 16:53:13 -0500 Received: from baldur.buserror.net ([165.227.176.147]:34472 "EHLO baldur.buserror.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388351AbgCDVxN (ORCPT ); Wed, 4 Mar 2020 16:53:13 -0500 Received: from [2601:449:8480:af0:12bf:48ff:fe84:c9a0] by baldur.buserror.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1j9bws-0000aD-Ml; Wed, 04 Mar 2020 15:53:03 -0600 Message-ID: <5737c82b1ab4c80e53904e4846694884ca429569.camel@buserror.net> From: Scott Wood To: Jason Yan , mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, diana.craciun@nxp.com, christophe.leroy@c-s.fr, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, keescook@chromium.org, kernel-hardening@lists.openwall.com Cc: linux-kernel@vger.kernel.org, zhaohongjiang@huawei.com Date: Wed, 04 Mar 2020 15:53:01 -0600 In-Reply-To: <20200206025825.22934-6-yanaijie@huawei.com> References: <20200206025825.22934-1-yanaijie@huawei.com> <20200206025825.22934-6-yanaijie@huawei.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2601:449:8480:af0:12bf:48ff:fe84:c9a0 X-SA-Exim-Rcpt-To: yanaijie@huawei.com, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, diana.craciun@nxp.com, christophe.leroy@c-s.fr, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, keescook@chromium.org, kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, zhaohongjiang@huawei.com X-SA-Exim-Mail-From: oss@buserror.net X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on baldur.localdomain X-Spam-Level: X-Spam-Status: No, score=-17.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -15 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -1.5 GREYLIST_ISWHITE The incoming server has been whitelisted for * this recipient and sender Subject: Re: [PATCH v3 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on baldur.buserror.net) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-02-06 at 10:58 +0800, Jason Yan wrote: > The original kernel still exists in the memory, clear it now. > > Signed-off-by: Jason Yan > Cc: Scott Wood > Cc: Diana Craciun > Cc: Michael Ellerman > Cc: Christophe Leroy > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Nicholas Piggin > Cc: Kees Cook > --- > arch/powerpc/mm/nohash/kaslr_booke.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/mm/nohash/kaslr_booke.c > b/arch/powerpc/mm/nohash/kaslr_booke.c > index c6f5c1db1394..ed1277059368 100644 > --- a/arch/powerpc/mm/nohash/kaslr_booke.c > +++ b/arch/powerpc/mm/nohash/kaslr_booke.c > @@ -378,8 +378,10 @@ notrace void __init kaslr_early_init(void *dt_ptr, > phys_addr_t size) > unsigned int *__kaslr_offset = (unsigned int *)(KERNELBASE + 0x58); > unsigned int *__run_at_load = (unsigned int *)(KERNELBASE + 0x5c); > > - if (*__run_at_load == 1) > + if (*__run_at_load == 1) { > + kaslr_late_init(); > return; > + } What if you're here because kexec set __run_at_load (or CONFIG_RELOCATABLE_TEST is enabled), not because kaslr happened? -Scott