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


Groups > linux.kernel > #1538367

Re: [PATCH 2/2] x86/KASLR/64: Determine kernel text mapping size at runtime

From Baoquan He <bhe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] x86/KASLR/64: Determine kernel text mapping size at runtime
Date 2016-12-08 09:30 +0100
Message-ID <sM2fv-3Ni-1@gated-at.bofh.it> (permalink)
References <sM1Mt-3ja-11@gated-at.bofh.it> <sM1Mt-3ja-17@gated-at.bofh.it> <sM25P-3Kk-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/08/16 at 02:17pm, Alexnader Kuleshov wrote:
> Hello,
> 
> On 12-08-16, Baoquan He wrote:
> >  #define KERNEL_MAPPING_SIZE_EXT	(1024 * 1024 * 1024)
> > -#if defined(CONFIG_RANDOMIZE_BASE)
> > -#define KERNEL_IMAGE_SIZE	KERNEL_MAPPING_SIZE_EXT
> > -#else
> > -#define KERNEL_IMAGE_SIZE	(512 * 1024 * 1024)
> > -#endif
> > +#define KERNEL_MAPPING_SIZE	kernel_mapping_size

Thanks for telling. I forget testing this case. Checking.

> 
> After applying these patches I'm getting:
> 
>   CC      arch/x86/kernel/setup.o
> In file included from ./arch/x86/include/asm/page_types.h:47:0,
>                  from ./arch/x86/include/asm/page.h:8,
>                  from ./arch/x86/include/asm/thread_info.h:11,
>                  from ./include/linux/thread_info.h:58,
>                  from ./arch/x86/include/asm/preempt.h:6,
>                  from ./include/linux/preempt.h:59,
>                  from ./include/linux/spinlock.h:50,
>                  from ./include/linux/seqlock.h:35,
>                  from ./include/linux/time.h:5,
>                  from ./include/uapi/linux/timex.h:56,
>                  from ./include/linux/timex.h:56,
>                  from ./include/linux/sched.h:19,
>                  from arch/x86/kernel/setup.c:24:
> arch/x86/kernel/setup.c: In function ‘dump_kernel_offset’:
> ./arch/x86/include/asm/page_64_types.h:67:29: error: ‘kernel_mapping_size’ undeclared (first use in this function)
>  #define KERNEL_MAPPING_SIZE kernel_mapping_size
>                              ^
> ./arch/x86/include/asm/pgtable_64_types.h:69:48: note: in expansion of macro ‘KERNEL_MAPPING_SIZE’
>  #define MODULES_VADDR    (__START_KERNEL_map + KERNEL_MAPPING_SIZE)
>                                                 ^~~~~~~~~~~~~~~~~~~
> ./include/linux/printk.h:271:35: note: in expansion of macro ‘MODULES_VADDR’
>   printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
>                                    ^~~~~~~~~~~
> arch/x86/kernel/setup.c:826:3: note: in expansion of macro ‘pr_emerg’
>    pr_emerg("Kernel Offset: 0x%lx from 0x%lx (relocation range: 0x%lx-0x%lx)\n",
>    ^~~~~~~~
> ./arch/x86/include/asm/page_64_types.h:67:29: note: each undeclared identifier is reported only once for each function it appears in
>  #define KERNEL_MAPPING_SIZE kernel_mapping_size
>                              ^
> ./arch/x86/include/asm/pgtable_64_types.h:69:48: note: in expansion of macro ‘KERNEL_MAPPING_SIZE’
>  #define MODULES_VADDR    (__START_KERNEL_map + KERNEL_MAPPING_SIZE)
>                                                 ^~~~~~~~~~~~~~~~~~~
> ./include/linux/printk.h:271:35: note: in expansion of macro ‘MODULES_VADDR’
>   printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
>                                    ^~~~~~~~~~~
> arch/x86/kernel/setup.c:826:3: note: in expansion of macro ‘pr_emerg’
>    pr_emerg("Kernel Offset: 0x%lx from 0x%lx (relocation range: 0x%lx-0x%lx)\n",
>    ^~~~~~~~
> scripts/Makefile.build:293: recipe for target 'arch/x86/kernel/setup.o' failed
> make[2]: *** [arch/x86/kernel/setup.o] Error 1
> scripts/Makefile.build:544: recipe for target 'arch/x86/kernel' failed
> make[1]: *** [arch/x86/kernel] Error 2
> Makefile:988: recipe for target 'arch/x86' failed
> make: *** [arch/x86] Error 2
> 
> here with disabled CONFIG_RANDOMIZE_MEMORY.

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


Thread

[PATCH 2/2] x86/KASLR/64: Determine kernel text mapping size at runtime Baoquan He <bhe@redhat.com> - 2016-12-08 09:00 +0100
  Re: [PATCH 2/2] x86/KASLR/64: Determine kernel text mapping size at  runtime Alexnader Kuleshov <kuleshovmail@gmail.com> - 2016-12-08 09:20 +0100
    Re: [PATCH 2/2] x86/KASLR/64: Determine kernel text mapping size at  runtime Baoquan He <bhe@redhat.com> - 2016-12-08 09:30 +0100
  Re: [PATCH 2/2] x86/KASLR/64: Determine kernel text mapping size at  runtime Baoquan He <bhe@redhat.com> - 2016-12-08 14:50 +0100

csiph-web