linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, hpa@zytor.com, mingo@redhat.com,
	x86@kernel.org, keescook@chromium.org, yinghai@kernel.org,
	bp@suse.de, thgarnie@google.com, kuleshovmail@gmail.com,
	luto@kernel.org, mcgrof@kernel.org, anderson@redhat.com,
	dyoung@redhat.com, xlpang@redhat.com, Baoquan He <bhe@redhat.com>
Subject: [PATCH v2 0/2] Determine kernel text mapping size at runtime for x86_64
Date: Fri,  9 Dec 2016 22:41:56 +0800	[thread overview]
Message-ID: <1481294518-29595-1-git-send-email-bhe@redhat.com> (raw)

The current kernel sets KERNEL_IMAGE_SIZE as 1G as long as CONFIG_RANDOMIZE_BASE
is enabled, though people specify "nokaslr" into cmdline to disable kaslr
explicitly. This could be a wrong behaviour. CONFIG_RANDOMIZE_BASE should only
decide if KASLR code need be compiled in. If user specify "nokaslr", kernel should
should behave as no KASLR code compiled in at all.

So in this patchset, made changes to determine the size of kernel text mapping
area at runtime. If "nokaslr" specified, kernel mapping size is 512M though
CONFIG_RANDOMIZE_BASE is enabled.


Baoquan He (2):
  x86/64: Make kernel text mapping always take one whole page table in
    early boot code
  x86/KASLR/64: Determine kernel text mapping size at runtime

 arch/x86/boot/compressed/kaslr.c        | 20 +++++++++++++++-----
 arch/x86/include/asm/kaslr.h            |  1 +
 arch/x86/include/asm/page_64_types.h    | 20 ++++++++++++--------
 arch/x86/include/asm/pgtable_64_types.h |  2 +-
 arch/x86/kernel/head64.c                | 11 ++++++-----
 arch/x86/kernel/head_64.S               | 16 +++++++++-------
 arch/x86/mm/dump_pagetables.c           |  3 ++-
 arch/x86/mm/init_64.c                   |  2 +-
 arch/x86/mm/physaddr.c                  |  6 +++---
 9 files changed, 50 insertions(+), 31 deletions(-)

-- 
2.5.5

             reply	other threads:[~2016-12-09 14:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-09 14:41 Baoquan He [this message]
2016-12-09 14:41 ` [PATCH v2 1/2] x86/64: Make kernel text mapping always take one whole page table in early boot code Baoquan He
2016-12-09 14:41 ` [PATCH v2 2/2] x86/KASLR/64: Determine kernel text mapping size at runtime Baoquan He
2016-12-10 10:31   ` Borislav Petkov
2016-12-10 12:27     ` Baoquan He
2016-12-10 12:33       ` Borislav Petkov
2016-12-10 13:41         ` Baoquan He
2016-12-10 16:28           ` Borislav Petkov
2016-12-11 10:58             ` Baoquan He
2016-12-11 12:06               ` Borislav Petkov
2016-12-12  2:32                 ` Baoquan He

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=1481294518-29595-1-git-send-email-bhe@redhat.com \
    --to=bhe@redhat.com \
    --cc=anderson@redhat.com \
    --cc=bp@suse.de \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=kuleshovmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    --cc=x86@kernel.org \
    --cc=xlpang@redhat.com \
    --cc=yinghai@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).