mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: mingo@kernel.org, linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, hpa@zytor.com, Baoquan He <bhe@redhat.com>
Subject: [PATCH v2 0/2] x86/boot/KASLR: Code bug fix about kernel virtual address randomization
Date: Tue, 27 Jun 2017 20:39:04 +0800	[thread overview]
Message-ID: <1498567146-11990-1-git-send-email-bhe@redhat.com> (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

             reply	other threads:[~2017-06-27 12:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27 12:39 Baoquan He [this message]
2017-06-27 12:39 ` [PATCH v2 1/2] x86/boot/KASLR: Add checking for the offset of " Baoquan He
2017-06-30 13:07   ` [tip:x86/urgent] " tip-bot for Baoquan He
2017-06-27 12:39 ` [PATCH v2 2/2] x86/boot/KASLR: Fix the wrong assignment to 'virt_addr' Baoquan He
2017-06-30 13:08   ` [tip:x86/urgent] x86/boot/KASLR: Fix kexec crash due to 'virt_addr' calculation bug tip-bot for Baoquan He
2017-06-30  6:14 ` [PATCH v2 0/2] x86/boot/KASLR: Code bug fix about kernel virtual address randomization Dave Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1498567146-11990-1-git-send-email-bhe@redhat.com \
    --to=bhe@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome