From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755955AbcG0MJw (ORCPT ); Wed, 27 Jul 2016 08:09:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:59481 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755569AbcG0MJu (ORCPT ); Wed, 27 Jul 2016 08:09:50 -0400 Date: Wed, 27 Jul 2016 14:09:39 +0200 From: Borislav Petkov To: Ingo Molnar Cc: Kees Cook , Thomas Garnier , Nicolai Stange , Thomas Gleixner , "H. Peter Anvin" , Peter Zijlstra , "linux-tip-commits@vger.kernel.org" , LKML , Linus Torvalds Subject: [PATCH] x86/asm, microcode: Add __PAGE_OFFSET_BASE define on 32-bit Message-ID: <20160727120939.GA18911@nazgul.tnic> References: <20160726095138.3470-1-bp@alien8.de> <20160727054543.GB3142@nazgul.tnic> <20160727080917.GA3009@nazgul.tnic> <20160727090516.GC30204@gmail.com> <20160727091025.GC3009@nazgul.tnic> <20160727103655.GA8845@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160727103655.GA8845@gmail.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 27, 2016 at 12:36:55PM +0200, Ingo Molnar wrote: > On top of: > > tip/x86/microcode df15929f8f5c: Merge branch 'linus' into x86/microcode, to pick up merge window changes > > (the merge commit is fresh, I just pushed it out) > > ... because this way there's actually a CONFIG_RANDOMIZE_MEMORY option available > in that kernel tree. Here it is: --- From: Borislav Petkov Subject: [PATCH] x86/asm, 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 --- 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 3a52ee0e726d..3bae4969ac65 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 0f97ae93441b..cdc0deab00c9 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); -- 2.8.4 -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --