Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1640298imm; Thu, 12 Jul 2018 05:33:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdBMvH0t1rIsCn7iNfV0zqX0T0Bk8n9oF9GJrvSTEiwe5Aynj2XgOc9SLomJvrzJKDrIg7f X-Received: by 2002:a17:902:e101:: with SMTP id cc1-v6mr2024553plb.96.1531398836500; Thu, 12 Jul 2018 05:33:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531398836; cv=none; d=google.com; s=arc-20160816; b=GWEeaISg5uqq6BgmNSLT8SmTDrbw+2wlXpRoPabXSj8jNIPFJSTIVPWlAiSiS+o8+P QJfzI0iQWAk5e//gpOHeA5pK5b29UdRrZcXLY4ZKl124Ckk3E33FhGoEkA5y9cfENGob TPg1LNx5V9rWWFDET3aOq82hUaD3qzGwOHUJiZQDoTvSvgkPgaeVg+hQ8md/aG8Mj41O 5/B4tU5M9WBT4Hk1PfXl9oD7DmexwHON4MNKUTI2+DNpVzQIAk3kXdLWjMkJdxXv+r6/ oGCzxTPKvIqEuVHxiogrEDwqDiECQdKkkZC8ASThizTx9LuiVutJax8LK5vIAt/cuLLf 1MOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Ef20yocu2XdCbdDgRXxgTi4mJrmvOue6QDG1ILVvhxI=; b=eqCNU8YiwoD1XzeXfnixApd/OpzXyTaz8zHUR4WvvExR3xBabmQTjdkJTgWo5LF5rl kOfkYxEEJEXaqRYafTrZiJTMzFYtSo/2YJ2ZAgLME3AQvcy+9lewXPuDDm0C0ECR9d6A CDuCkGpNC2WCpvEcBSB7Eci0mMu91YAMXs95snokPpPN6jmJz4kR2Yl/S/u87rPUre0P 9VDO37zoKhkCwejeSWR8Pal48seS1lgfEOU6dMNBcJ0U3rFqBZFCDI+0yWXE/9kY9L87 BE3Mr0pIIm/8Ua/Bawst3/mxp9hUm+3Tw41tnAXqrIEaHFQAdYGK6LlO8W7VkBR9imyL VyTA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26-v6si21220936pgl.49.2018.07.12.05.33.41; Thu, 12 Jul 2018 05:33:56 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732411AbeGLMlw (ORCPT + 99 others); Thu, 12 Jul 2018 08:41:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:40190 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726663AbeGLMlw (ORCPT ); Thu, 12 Jul 2018 08:41:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C845DADAD; Thu, 12 Jul 2018 12:32:28 +0000 (UTC) Date: Thu, 12 Jul 2018 14:32:28 +0200 From: Michal Hocko To: Chao Fan Cc: Dou Liyang , Baoquan He , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org, yasu.isimatu@gmail.com, keescook@chromium.org, indou.takao@jp.fujitsu.com, caoj.fnst@cn.fujitsu.com, vbabka@suse.cz, mgorman@techsingularity.net Subject: Re: Bug report about KASLR and ZONE_MOVABLE Message-ID: <20180712123228.GK32648@dhcp22.suse.cz> References: <20180711094244.GA2019@localhost.localdomain> <20180711104158.GE2070@MiWiFi-R3L-srv> <20180711104944.GG1969@MiWiFi-R3L-srv> <20180711124008.GF2070@MiWiFi-R3L-srv> <72721138-ba6a-32c9-3489-f2060f40a4c9@cn.fujitsu.com> <20180712060115.GD6742@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712060115.GD6742@localhost.localdomain> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 12-07-18 14:01:15, Chao Fan wrote: > On Thu, Jul 12, 2018 at 01:49:49PM +0800, Dou Liyang wrote: > >Hi Baoquan, > > > >At 07/11/2018 08:40 PM, Baoquan He wrote: > >> Please try this v3 patch: > >> >>From 9850d3de9c02e570dc7572069a9749a8add4c4c7 Mon Sep 17 00:00:00 2001 > >> From: Baoquan He > >> Date: Wed, 11 Jul 2018 20:31:51 +0800 > >> Subject: [PATCH v3] mm, page_alloc: find movable zone after kernel text > >> > >> In find_zone_movable_pfns_for_nodes(), when try to find the starting > >> PFN movable zone begins in each node, kernel text position is not > >> considered. KASLR may put kernel after which movable zone begins. > >> > >> Fix it by finding movable zone after kernel text on that node. > >> > >> Signed-off-by: Baoquan He > > > > > >You fix this in the _zone_init side_. This may make the 'kernelcore=' or > >'movablecore=' failed if the KASLR puts the kernel back the tail of the > >last node, or more. > > I think it may not fail. > There is a 'restart' to do another pass. > > > > >Due to we have fix the mirror memory in KASLR side, and Chao is trying > >to fix the 'movable_node' in KASLR side. Have you had a chance to fix > >this in the KASLR side. > > > > I think it's better to fix here, but not KASLR side. > Cause much more code will be change if doing it in KASLR side. > Since we didn't parse 'kernelcore' in compressed code, and you can see > the distribution of ZONE_MOVABLE need so much code, so we do not need > to do so much job in KASLR side. But here, several lines will be OK. I am not able to find the beginning of the email thread right now. Could you summarize what is the actual problem please? -- Michal Hocko SUSE Labs