Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1675625

[PATCH v2 0/2] x86/boot/KASLR: Code bug fix about kernel virtual address randomization

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Baoquan He <bhe@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v2 0/2] x86/boot/KASLR: Code bug fix about kernel virtual address randomization
Date Tue, 27 Jun 2017 14:40:01 +0200
Message-ID <tWXWF-tx-1@gated-at.bofh.it> (permalink)
Dmarc-Filter OpenDMARC Filter v1.3.2 mx1.redhat.com 8805C64D28
Authentication-Results ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=bhe@redhat.com
Dkim-Filter OpenDKIM Filter v2.11.0 mx1.redhat.com 8805C64D28
X-Scanned-By MIMEDefang 2.79 on 10.5.11.13
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 27 Jun 2017 12:39:12 +0000 (UTC)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 30
Organization linux.* mail to news gateway
X-Original-Cc tglx@linutronix.de, hpa@zytor.com, Baoquan He <bhe@redhat.com>
X-Original-Date Tue, 27 Jun 2017 20:39:04 +0800
X-Original-Message-ID <1498567146-11990-1-git-send-email-bhe@redhat.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1675625

Show key headers only | View raw


People complained that crashkernel high doesn't work when kaslr code
compiled in but add 'nokaslr' to diable it. Kexec has the same
phenomenon.

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

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] x86/boot/KASLR: Code bug fix about kernel virtual address randomization Baoquan He <bhe@redhat.com> - 2017-06-27 14:40 +0200
  [PATCH v2 1/2] x86/boot/KASLR: Add checking for the offset of kernel virtual address randomization Baoquan He <bhe@redhat.com> - 2017-06-27 14:40 +0200
    [tip:x86/urgent] x86/boot/KASLR: Add checking for the offset of  kernel virtual address randomization tip-bot for Baoquan He <tipbot@zytor.com> - 2017-06-30 15:20 +0200
  [PATCH v2 2/2] x86/boot/KASLR: Fix the wrong assignment to 'virt_addr' Baoquan He <bhe@redhat.com> - 2017-06-27 14:40 +0200
    [tip:x86/urgent] x86/boot/KASLR: Fix kexec crash due to 'virt_addr'  calculation bug tip-bot for Baoquan He <tipbot@zytor.com> - 2017-06-30 15:20 +0200
  Re: [PATCH v2 0/2] x86/boot/KASLR: Code bug fix about kernel virtual  address randomization Dave Young <dyoung@redhat.com> - 2017-06-30 08:20 +0200

csiph-web