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


Groups > linux.kernel > #1539418

[PATCH v2 0/2] Determine kernel text mapping size at runtime for x86_64

From Baoquan He <bhe@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v2 0/2] Determine kernel text mapping size at runtime for x86_64
Date 2016-12-09 15:50 +0100
Message-ID <sMuEN-4tz-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View 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

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


Thread

[PATCH v2 0/2] Determine kernel text mapping size at runtime for x86_64 Baoquan He <bhe@redhat.com> - 2016-12-09 15:50 +0100
  [PATCH v2 2/2] x86/KASLR/64: Determine kernel text mapping size at runtime Baoquan He <bhe@redhat.com> - 2016-12-09 15:50 +0100
    Re: [PATCH v2 2/2] x86/KASLR/64: Determine kernel text mapping size  at runtime Borislav Petkov <bp@suse.de> - 2016-12-10 11:40 +0100
      Re: [PATCH v2 2/2] x86/KASLR/64: Determine kernel text mapping size  at runtime Baoquan He <bhe@redhat.com> - 2016-12-10 13:30 +0100
        Re: [PATCH v2 2/2] x86/KASLR/64: Determine kernel text mapping size  at runtime Borislav Petkov <bp@suse.de> - 2016-12-10 13:40 +0100
          Re: [PATCH v2 2/2] x86/KASLR/64: Determine kernel text mapping size  at runtime Baoquan He <bhe@redhat.com> - 2016-12-10 14:50 +0100
            Re: [PATCH v2 2/2] x86/KASLR/64: Determine kernel text mapping size  at runtime Borislav Petkov <bp@suse.de> - 2016-12-10 17:30 +0100
  [PATCH v2 1/2] x86/64: Make kernel text mapping always take one whole page table in early boot code Baoquan He <bhe@redhat.com> - 2016-12-09 15:50 +0100

csiph-web