summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/microcode_amd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-11-11 11:29:10 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-11-11 11:29:10 -0800
commit605f37504f3afb590bf852bae4da5af8e462688e (patch)
tree63032ec80554fd50d97639d8380cfa962fc3a721 /arch/x86/kernel/microcode_amd.c
parent16fe4101ae265e908615702806ee3b28ab1c8370 (diff)
parent506f90eeae682dc96c11c7aefac0262b3a560b49 (diff)
downloadlinux-605f37504f3afb590bf852bae4da5af8e462688e.tar.bz2
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86, amd-ucode: Check UCODE_MAGIC before loading the container file x86: Fix error return sequence in __ioremap_caller() x86: Add Phoenix/MSC BIOSes to lowmem corruption list
Diffstat (limited to 'arch/x86/kernel/microcode_amd.c')
-rw-r--r--arch/x86/kernel/microcode_amd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 366baa179913..f4c538b681ca 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -317,6 +317,12 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device)
return UCODE_NFOUND;
}
+ if (*(u32 *)firmware->data != UCODE_MAGIC) {
+ printk(KERN_ERR "microcode: invalid UCODE_MAGIC (0x%08x)\n",
+ *(u32 *)firmware->data);
+ return UCODE_ERROR;
+ }
+
ret = generic_load_microcode(cpu, firmware->data, firmware->size);
release_firmware(firmware);