Skip to content

Commit 4a1a8e1

Browse files
suryasaimadhuIngo Molnar
authored andcommitted
x86/asm, x86/microcode: Add __PAGE_OFFSET_BASE define on 32-bit
... in order to avoid #ifdeffery in code computing the ASLR randomization offset. Remove that #ifdeffery in the microcode loader. Suggested-by: Kees Cook <keescook@chromium.org> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Nicolai Stange <nicstange@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Garnier <thgarnie@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20160727120939.GA18911@nazgul.tnic Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent df15929 commit 4a1a8e1

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

arch/x86/include/asm/page_32_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
* If you want more physical memory than this then see the CONFIG_HIGHMEM4G
1414
* and CONFIG_HIGHMEM64G options in the kernel configuration.
1515
*/
16-
#define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
16+
#define __PAGE_OFFSET_BASE _AC(CONFIG_PAGE_OFFSET, UL)
17+
#define __PAGE_OFFSET __PAGE_OFFSET_BASE
1718

1819
#define __START_KERNEL_map __PAGE_OFFSET
1920

arch/x86/kernel/cpu/microcode/intel.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,13 +818,11 @@ void load_ucode_intel_ap(void)
818818
if (blobs_p->valid) {
819819
start = blobs_p->start;
820820

821-
#ifdef CONFIG_RANDOMIZE_MEMORY
822821
/*
823822
* Pay attention to CONFIG_RANDOMIZE_MEMORY=y as it shuffles
824823
* physmem mapping too and there we have the initrd.
825824
*/
826825
start += PAGE_OFFSET - __PAGE_OFFSET_BASE;
827-
#endif
828826
}
829827

830828
collect_cpu_info_early(&uci);

0 commit comments

Comments
 (0)