Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp698253ybv; Thu, 20 Feb 2020 05:51:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzEJZ0K0gCLXeg7O8ZGhK6JGWTOfPAUFfzO7JjLvJGIkZgrgkYMP75C06O9lGc1tSrUTYEs X-Received: by 2002:aca:4d58:: with SMTP id a85mr2080775oib.166.1582206674315; Thu, 20 Feb 2020 05:51:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582206674; cv=none; d=google.com; s=arc-20160816; b=vIHrrno2M+8RB4P/5m08Lnh15RgC3SWHL6BV5wb5lG97RAg67ojYvg6LrpOY96pAwW nFYjOaQZYK3sue2+VoT7v1n9w3w4pjP+FLnIDrVbnlukgnmMpkVnuA6dq25WIvpUvqSB LGDQUolNEKhQFTheEot5j8Q9C5PpPJ8USQ3JpJnWVSOj3MiGNoK3Xa2yRezkUckKEirp fokvhmLhxgh/rog+wQJMe+/I7jwJ9k4FQkNImfMd8o5ms3BKvCIckOOX8NUIWM8M+Bck kYZaCfM7C23GeFOzv0/JICBoSfG775mc0LtX2q5VHgHTXP4D8IJf2QUSxeQDiWgU6b+i xlMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=BNmen+R0A95fKF9yP5dTxuzGe+sL7dAQ7ChpuSoUS5c=; b=NFkSe9pZLPhewRcG62FOmZxA/DBDDZXDfsaz3XiUDhY2V7guiaUQWWm+2z1TJCTF30 5G/IlrJaGFgWmWTd1cVnxNj+kAYdqQ8SbXWsjyJt/49xzazK51B+U5OAK0k5ZMeCeOC4 T+yhNnlZQRB8U4363WYHpwxnIaBA7kSMYKLK9Ou86LcNblT5wvTcdfnCNyLdKALRDU+t RrbTxPQenh9X8SXLcy/o550qWX2jluPDSU8/1dMBTYkKUdfaO4h8cVDfSWbhVJufRrHR EleeZdVhs175Qx9bc9j/beu1b463FyN2vpfCgEeBy3Oq+bUB3p7qGNckcCa843hLjaX/ cU5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=Mlu6cmGM; 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 j15si2772159oie.15.2020.02.20.05.51.02; Thu, 20 Feb 2020 05:51:14 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=Mlu6cmGM; 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 S1728225AbgBTNtr (ORCPT + 99 others); Thu, 20 Feb 2020 08:49:47 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:32729 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728117AbgBTNtq (ORCPT ); Thu, 20 Feb 2020 08:49:46 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48NbYh1hVyz9v0MK; Thu, 20 Feb 2020 14:49:44 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=Mlu6cmGM; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id OFAoWcNwe3RW; Thu, 20 Feb 2020 14:49:44 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48NbYh0JY5z9v0MJ; Thu, 20 Feb 2020 14:49:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582206584; bh=BNmen+R0A95fKF9yP5dTxuzGe+sL7dAQ7ChpuSoUS5c=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Mlu6cmGMba4L0sYZwxMEPfQwvJ+HCjrFncFIsGGZhNyFJqdvp9qEWWiTgnEWpp9RL pciPb9n1ehAPK8yK4dlvakvdTx+sF/pfbSYPOROhLft3wEXG7RqrGpunAuYLHnv2JL o4VjCgVlhpSuA13ZUihgB11Y+lLOuB4UgA0nkJHE= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 61A838B86D; Thu, 20 Feb 2020 14:49:45 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id N_Jiuu8x05kS; Thu, 20 Feb 2020 14:49:45 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id ACB748B866; Thu, 20 Feb 2020 14:49:44 +0100 (CET) Subject: Re: [PATCH v3 5/6] powerpc/fsl_booke/64: clear the original kernel if randomized To: Jason Yan , mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, diana.craciun@nxp.com, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, keescook@chromium.org, kernel-hardening@lists.openwall.com, oss@buserror.net Cc: linux-kernel@vger.kernel.org, zhaohongjiang@huawei.com References: <20200206025825.22934-1-yanaijie@huawei.com> <20200206025825.22934-6-yanaijie@huawei.com> From: Christophe Leroy Message-ID: <0f778e1c-5e29-e600-1cf0-aeb3e1a6fe08@c-s.fr> Date: Thu, 20 Feb 2020 14:49:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200206025825.22934-6-yanaijie@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 06/02/2020 à 03:58, Jason Yan a écrit : > The original kernel still exists in the memory, clear it now. No such problem with PPC32 ? Or is that common ? Christophe > > 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; > + } > > /* Setup flat device-tree pointer */ > initial_boot_params = dt_ptr; >