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


Groups > linux.kernel > #1384833

Re: [PATCH 2/5] x86, KASLR: Drop CONFIG_RANDOMIZE_BASE_MAX_OFFSET

From Borislav Petkov <bp@suse.de>
Newsgroups linux.kernel
Subject Re: [PATCH 2/5] x86, KASLR: Drop CONFIG_RANDOMIZE_BASE_MAX_OFFSET
Date 2016-04-22 11:50 +0200
Message-ID <rqFSP-8hs-15@gated-at.bofh.it> (permalink)
References <rq7o5-5F5-3@gated-at.bofh.it> <rq7o5-5F5-1@gated-at.bofh.it> <rqqTN-4ry-21@gated-at.bofh.it> <rqrmO-52G-37@gated-at.bofh.it> <rqDxE-6zr-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Apr 22, 2016 at 09:16:12AM +0200, Ingo Molnar wrote:
> 
> * Kees Cook <keescook@chromium.org> wrote:
> 
> > >> +       Since the kernel is built using 2GB addressing,
> > >
> > > Does that try to refer to the 1G kernel and 1G fixmap pagetable
> > > mappings? I.e., level2_kernel_pgt and level2_fixmap_pgt in
> > > arch/x86/kernel/head_64.S?
> > 
> > The "2GB addressing" part is in reference to:
> > 
> >        -mcmodel=kernel
> >            Generate code for the kernel code model.  The kernel runs in the
> >            negative 2 GB of the address space.  This model has to be used for
> >            Linux kernel code.
> 
> On x86-64 this is a special GCC compiler small memory model, it is called the 
> 'kernel code model', which is rather generic and no 'real name' ever stuck.
> 
> Due to RIP-relative addressing and the sign-extension of 48 bit virtual addresses, 
> this allows nearly as compact kernel code and (static) kernel data definitions as 
> a 32-bit kernel would allow.
> 
> The (positive) 0-4GB virtual memory range has similar advantages, but is of course 
> frequently used by user-space code. Negative addresses are reserved for the kernel 
> only.

So it wouldn't hurt to have a more detailed explanation like this one in
the text. And the 2G thing confused me maybe because it actually means
32-bit: 0x8000_0000 is 2G and is negative since the MSB is 1b. And I was
wondering: "but what about 64-bit...?"

Thanks.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

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


Thread

[PATCH 2/5] x86, KASLR: Drop CONFIG_RANDOMIZE_BASE_MAX_OFFSET Kees Cook <keescook@chromium.org> - 2016-04-20 23:00 +0200
  Re: [PATCH 2/5] x86, KASLR: Drop CONFIG_RANDOMIZE_BASE_MAX_OFFSET Borislav Petkov <bp@suse.de> - 2016-04-21 19:50 +0200
    Re: [PATCH 2/5] x86, KASLR: Drop CONFIG_RANDOMIZE_BASE_MAX_OFFSET Kees Cook <keescook@chromium.org> - 2016-04-21 20:20 +0200
      Re: [PATCH 2/5] x86, KASLR: Drop CONFIG_RANDOMIZE_BASE_MAX_OFFSET Ingo Molnar <mingo@kernel.org> - 2016-04-22 09:20 +0200
        Re: [PATCH 2/5] x86, KASLR: Drop CONFIG_RANDOMIZE_BASE_MAX_OFFSET Borislav Petkov <bp@suse.de> - 2016-04-22 11:50 +0200
  [tip:x86/boot] x86/KASLR: Drop CONFIG_RANDOMIZE_BASE_MAX_OFFSET tip-bot for Baoquan He <tipbot@zytor.com> - 2016-04-22 11:50 +0200

csiph-web