public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Borislav Petkov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de,
	torvalds@linux-foundation.org, peterz@infradead.org,
	keescook@chromium.org, bp@suse.de, thgarnie@google.com,
	mingo@kernel.org, nicstange@gmail.com
Subject: [tip:x86/microcode] x86/asm, x86/microcode: Add __PAGE_OFFSET_BASE define on 32-bit
Date: Wed, 27 Jul 2016 10:10:00 -0700	[thread overview]
Message-ID: <tip-4a1a8e1b8f9f37bdbba416eb0a5ff3f47d31cb28@git.kernel.org> (raw)
In-Reply-To: <20160727120939.GA18911@nazgul.tnic>

Commit-ID:  4a1a8e1b8f9f37bdbba416eb0a5ff3f47d31cb28
Gitweb:     http://git.kernel.org/tip/4a1a8e1b8f9f37bdbba416eb0a5ff3f47d31cb28
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Wed, 27 Jul 2016 14:09:39 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 27 Jul 2016 14:59:59 +0200

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>
---
 arch/x86/include/asm/page_32_types.h  | 3 ++-
 arch/x86/kernel/cpu/microcode/intel.c | 2 --
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/page_32_types.h b/arch/x86/include/asm/page_32_types.h
index 3a52ee0..3bae496 100644
--- a/arch/x86/include/asm/page_32_types.h
+++ b/arch/x86/include/asm/page_32_types.h
@@ -13,7 +13,8 @@
  * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
  * and CONFIG_HIGHMEM64G options in the kernel configuration.
  */
-#define __PAGE_OFFSET		_AC(CONFIG_PAGE_OFFSET, UL)
+#define __PAGE_OFFSET_BASE	_AC(CONFIG_PAGE_OFFSET, UL)
+#define __PAGE_OFFSET		__PAGE_OFFSET_BASE
 
 #define __START_KERNEL_map	__PAGE_OFFSET
 
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 0f97ae9..cdc0dea 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -818,13 +818,11 @@ void load_ucode_intel_ap(void)
 	if (blobs_p->valid) {
 		start = blobs_p->start;
 
-#ifdef CONFIG_RANDOMIZE_MEMORY
 		/*
 		 * Pay attention to CONFIG_RANDOMIZE_MEMORY=y as it shuffles
 		 * physmem mapping too and there we have the initrd.
 		 */
 		start += PAGE_OFFSET - __PAGE_OFFSET_BASE;
-#endif
 	}
 
 	collect_cpu_info_early(&uci);

  reply	other threads:[~2016-07-27 17:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26  9:51 [PATCH] x86/microcode/intel: Fix initrd loading with CONFIG_RANDOMIZE_MEMORY Borislav Petkov
2016-07-26 17:37 ` [tip:x86/microcode] x86/microcode/intel: Fix initrd loading with CONFIG_RANDOMIZE_MEMORY=y tip-bot for Borislav Petkov
2016-07-26 20:37   ` Kees Cook
2016-07-27  5:45     ` Borislav Petkov
2016-07-27  8:09       ` [PATCH -v2 1/2] x86/asm: Add __PAGE_OFFSET_BASE define on 32-bit Borislav Petkov
2016-07-27  9:05         ` Ingo Molnar
2016-07-27  9:10           ` Borislav Petkov
2016-07-27 10:36             ` Ingo Molnar
2016-07-27 12:09               ` [PATCH] x86/asm, microcode: " Borislav Petkov
2016-07-27 17:10                 ` tip-bot for Borislav Petkov [this message]
2016-07-27  8:11       ` [PATCH -v2 2/2] x86/microcode/intel: Fix initrd loading with CONFIG_RANDOMIZE_MEMORY Borislav Petkov

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=tip-4a1a8e1b8f9f37bdbba416eb0a5ff3f47d31cb28@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nicstange@gmail.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    --cc=torvalds@linux-foundation.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