Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751947AbdF3GOb (ORCPT ); Fri, 30 Jun 2017 02:14:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55664 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751744AbdF3GOa (ORCPT ); Fri, 30 Jun 2017 02:14:30 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1FF31C056786 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dyoung@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1FF31C056786 Date: Fri, 30 Jun 2017 14:14:23 +0800 From: Dave Young To: Baoquan He Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com Subject: Re: [PATCH v2 0/2] x86/boot/KASLR: Code bug fix about kernel virtual address randomization Message-ID: <20170630061423.GA13433@dhcp-128-65.nay.redhat.com> References: <1498567146-11990-1-git-send-email-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1498567146-11990-1-git-send-email-bhe@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 30 Jun 2017 06:14:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1442 Lines: 36 On 06/27/17 at 08:39pm, Baoquan He wrote: > People complained that crashkernel high doesn't work when kaslr code > compiled in but add 'nokaslr' to diable it. Kexec has the same > phenomenon. This is a regression, with 4.12* kernel kexec reboot fails always on my desktop pc now without kaslr being enabled. > > The root cause is a code bug which assigned the original loading address > of kernel to the local variable 'virt_addr' which represents the offset > of kernel virtual address randmoization. As we know, kernel can be loaded > to anywhere under 64T physically, this wrong assignment could cause kernel > relocation handling of x86 64 error if no kaslr is taken. > > The v1 post can be found here: > x86/boot/KASLR: Skip relocation handling in no kaslr case > https://patchwork.kernel.org/patch/9807789/ > > In v2, Ingo suggested that we should add a judgement to check if 'virt_addr' > is randomized to make kernel beyond the kernel mapping area. This checking > can let us know the error but not reset to firmware quietly as it does now. > > Baoquan He (2): > x86/boot/KASLR: Add checking for the offset of kernel virtual address > randomization > x86/boot/KASLR: Fix the wrong assignment to 'virt_addr' > > arch/x86/boot/compressed/kaslr.c | 3 --- > arch/x86/boot/compressed/misc.c | 6 ++++-- > arch/x86/boot/compressed/misc.h | 2 -- > 3 files changed, 4 insertions(+), 7 deletions(-) > > -- > 2.5.5 >