[tip:x86/urgent] x86/microcode/AMD: Fix more fallout from CONFIG_RANDOMIZE_MEMORY=y
From: tip-bot for Borislav Petkov <hidden>
Date: 2016-10-28 08:40:27
Also in:
lkml
Subsystem:
the rest, x86 architecture (32-bit and 64-bit), x86 microcode update support · Maintainers:
Linus Torvalds, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen
Commit-ID: 1c27f646b18fb56308dff82784ca61951bad0b48 Gitweb: http://git.kernel.org/tip/1c27f646b18fb56308dff82784ca61951bad0b48 Author: Borislav Petkov [off-list ref] AuthorDate: Thu, 27 Oct 2016 14:36:23 +0200 Committer: Ingo Molnar [off-list ref] CommitDate: Fri, 28 Oct 2016 10:29:59 +0200 x86/microcode/AMD: Fix more fallout from CONFIG_RANDOMIZE_MEMORY=y We needed the physical address of the container in order to compute the offset within the relocated ramdisk. And we did this by doing __pa() on the virtual address. However, __pa() does checks whether the physical address is within PAGE_OFFSET and __START_KERNEL_map - see __phys_addr() - which fail if we have CONFIG_RANDOMIZE_MEMORY enabled: we feed a virtual address which *doesn't* have the randomization offset into a function which uses PAGE_OFFSET which *does* have that offset. This makes this check fire: VIRTUAL_BUG_ON((x > y) || !phys_addr_valid(x)); ^^^^^^ due to the randomization offset. The fix is as simple as using __pa_nodebug() because we do that randomization offset accounting later in that function ourselves. Reported-by: Bob Peterson <redacted> Tested-by: Bob Peterson <redacted> Signed-off-by: Borislav Petkov <redacted> Cc: Andreas Gruenbacher <agruenba@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <redacted> Cc: Denys Vlasenko <redacted> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Josh Poimboeuf <redacted> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mel Gorman <redacted> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Whitehouse <redacted> Cc: Thomas Gleixner <redacted> Cc: linux-mm <redacted> Cc: stable@vger.kernel.org # 4.9 Link: http://lkml.kernel.org/r/20161027123623.j2jri5bandimboff@pd.tnic Signed-off-by: Ingo Molnar <mingo@kernel.org> --- arch/x86/kernel/cpu/microcode/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index 620ab06..017bda1 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c@@ -429,7 +429,7 @@ int __init save_microcode_in_initrd_amd(void) * We need the physical address of the container for both bitness since * boot_params.hdr.ramdisk_image is a physical address. */ - cont = __pa(container); + cont = __pa_nodebug(container); cont_va = container; #endif --
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>