Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3282409ybi; Mon, 29 Jul 2019 04:02:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0t3bdxDKXrYmxxNK51hvINSJ9L3Rx8494mJQIl5Um5V+DWM2S/gWxUNqN6qnXCHFTAs0O X-Received: by 2002:a63:c203:: with SMTP id b3mr104993983pgd.450.1564398138609; Mon, 29 Jul 2019 04:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564398138; cv=none; d=google.com; s=arc-20160816; b=dOChlTWWbg9ds0NW4I6vjDgPEdu61VN2NhOoUooLwuBA0NpgvNTf1Rhvm8pI+5oJAN vqqorlNi0p3xTSf7oMQoANamOQdbKeudXZv4kILJrPnxP3CJO04BNI/OHxrm/6ZaApXc nU4UcT5YwhB4Yz9FuhaBZIcRPw5IHxadk41QPTY6/CqGNQl92LkWe5kFEx4lJl5Xal/R iurcBCjfSGTK/wIsOfr0F0738eitnGjoEz8vDo0zdtY4E3Pr/xPenOufK2eu52elHdTf gMGUKdm9cvFhuurezsXfKz7DgQi8YVUQBLy/sPreHZTmq3fs18ZtihNe7yTQb9BgjCzw 8l6A== 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=bemZgr0O0YrWgKD72zZXmB/7NTM9japGIRAflRk9J3A=; b=YR6X2vqHeeFLMZ95JaxQONs1fAg4WSW2uNXl+UJ4hf6izF7yEsio4yfBoBh++pgZxW rThCgeI6eBenJXANM1oVptaZJACcIiUXEhW6P6P5nSk9KfYQOYvLRxoKAQWZkXvaT0/6 fulyq1blj4N3Rqt11GiB4diBwYFSvKHPDo78AMlHbRXg+r2UrSkuf/fV7Xprra7Vfxia 42ShN1c4g6r1YV+Y/WhMKfJWPgRI+J9f/f5kRhoTsDrmtzFd2k98kb73UhtEGyighHkm +Fo4xIUb6EgGjHbNvP6AztRJqtN8wXoOqIR94Xu16yuk9qnoyzFWzVqjD3jnBlz0JBZw Fwmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=u7VDIQYA; 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 u1si23913770plb.234.2019.07.29.04.02.02; Mon, 29 Jul 2019 04:02:18 -0700 (PDT) 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=u7VDIQYA; 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 S2387555AbfG2LAa (ORCPT + 99 others); Mon, 29 Jul 2019 07:00:30 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:49148 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387424AbfG2LAa (ORCPT ); Mon, 29 Jul 2019 07:00:30 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 45xxYM4cjvz9vBJX; Mon, 29 Jul 2019 13:00:23 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=u7VDIQYA; 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 75McN48hltAx; Mon, 29 Jul 2019 13:00:23 +0200 (CEST) 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 45xxYM3X1vz9vBJW; Mon, 29 Jul 2019 13:00:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1564398023; bh=bemZgr0O0YrWgKD72zZXmB/7NTM9japGIRAflRk9J3A=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=u7VDIQYA8o5UGKYO+VADrupn8fkwbIncGUiSYVgqZetFSCre7dB7HBsrZuFrBSSXJ hEVH+GyB2Ex/kH70U/XHnti4QmZAftHkPgh+X+phSbtYs6gpF10rBt/CPPTYCE96wR f7kipDJ2s7j6IUcjaXGPf+bjw38FpZ/onKdv4bUg= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 53C358B7CB; Mon, 29 Jul 2019 13:00:28 +0200 (CEST) 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 iWTAXbeTw-ro; Mon, 29 Jul 2019 13:00:28 +0200 (CEST) Received: from [172.25.230.101] (po15451.idsi0.si.c-s.fr [172.25.230.101]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1D8A28B7B3; Mon, 29 Jul 2019 13:00:28 +0200 (CEST) Subject: Re: [RFC PATCH 03/10] powerpc: introduce kimage_vaddr to store the kernel base 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 Cc: linux-kernel@vger.kernel.org, wangkefeng.wang@huawei.com, yebin10@huawei.com, thunder.leizhen@huawei.com, jingxiangfeng@huawei.com, fanchengyang@huawei.com References: <20190717080621.40424-1-yanaijie@huawei.com> <20190717080621.40424-4-yanaijie@huawei.com> From: Christophe Leroy Message-ID: <7e19ade3-cb1a-a633-aa2d-ef5f182ba80c@c-s.fr> Date: Mon, 29 Jul 2019 13:00:28 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190717080621.40424-4-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 17/07/2019 à 10:06, Jason Yan a écrit : > Now the kernel base is a fixed value - KERNELBASE. To support KASLR, we > need a variable to store the kernel base. > > Signed-off-by: Jason Yan > Cc: Diana Craciun > Cc: Michael Ellerman > Cc: Christophe Leroy > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Nicholas Piggin > Cc: Kees Cook Reviewed-by: Christophe Leroy > --- > arch/powerpc/include/asm/page.h | 2 ++ > arch/powerpc/mm/init-common.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h > index 0d52f57fca04..60a68d3a54b1 100644 > --- a/arch/powerpc/include/asm/page.h > +++ b/arch/powerpc/include/asm/page.h > @@ -315,6 +315,8 @@ void arch_free_page(struct page *page, int order); > > struct vm_area_struct; > > +extern unsigned long kimage_vaddr; > + > #include > #endif /* __ASSEMBLY__ */ > #include > diff --git a/arch/powerpc/mm/init-common.c b/arch/powerpc/mm/init-common.c > index 9273c38009cb..c7a98c73e5c1 100644 > --- a/arch/powerpc/mm/init-common.c > +++ b/arch/powerpc/mm/init-common.c > @@ -25,6 +25,8 @@ phys_addr_t memstart_addr = (phys_addr_t)~0ull; > EXPORT_SYMBOL(memstart_addr); > phys_addr_t kernstart_addr; > EXPORT_SYMBOL(kernstart_addr); > +unsigned long kimage_vaddr = KERNELBASE; > +EXPORT_SYMBOL(kimage_vaddr); > > static bool disable_kuep = !IS_ENABLED(CONFIG_PPC_KUEP); > static bool disable_kuap = !IS_ENABLED(CONFIG_PPC_KUAP); >