From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757241AbcG0RKm (ORCPT ); Wed, 27 Jul 2016 13:10:42 -0400 Received: from terminus.zytor.com ([198.137.202.10]:47256 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753276AbcG0RKl (ORCPT ); Wed, 27 Jul 2016 13:10:41 -0400 Date: Wed, 27 Jul 2016 10:10:00 -0700 From: tip-bot for Borislav Petkov Message-ID: 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 Reply-To: keescook@chromium.org, bp@suse.de, mingo@kernel.org, thgarnie@google.com, nicstange@gmail.com, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, peterz@infradead.org, torvalds@linux-foundation.org In-Reply-To: <20160727120939.GA18911@nazgul.tnic> References: <20160727120939.GA18911@nazgul.tnic> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/microcode] x86/asm, x86/microcode: Add __PAGE_OFFSET_BASE define on 32-bit Git-Commit-ID: 4a1a8e1b8f9f37bdbba416eb0a5ff3f47d31cb28 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4a1a8e1b8f9f37bdbba416eb0a5ff3f47d31cb28 Gitweb: http://git.kernel.org/tip/4a1a8e1b8f9f37bdbba416eb0a5ff3f47d31cb28 Author: Borislav Petkov AuthorDate: Wed, 27 Jul 2016 14:09:39 +0200 Committer: Ingo Molnar 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 Signed-off-by: Borislav Petkov Cc: Linus Torvalds Cc: Nicolai Stange Cc: Peter Zijlstra Cc: Thomas Garnier Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20160727120939.GA18911@nazgul.tnic Signed-off-by: Ingo Molnar --- 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);