projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de2a47c
)
x86, amd-ucode: Check UCODE_MAGIC before loading the container file
author
Borislav Petkov
<
[email protected]
>
Thu, 29 Oct 2009 13:45:52 +0000
(14:45 +0100)
committer
Ingo Molnar
<
[email protected]
>
Tue, 10 Nov 2009 04:46:09 +0000
(
05:46
+0100)
Signed-off-by: Borislav Petkov <
[email protected]
>
Signed-off-by: Andreas Herrmann <
[email protected]
>
LKML-Reference: <
20091029134552
[email protected]
>
Signed-off-by: Ingo Molnar <
[email protected]
>
arch/x86/kernel/microcode_amd.c
patch
|
blob
|
history
diff --git
a/arch/x86/kernel/microcode_amd.c
b/arch/x86/kernel/microcode_amd.c
index 366baa179913dfc3e3e865480e82008a9ab5071a..f4c538b681cad13734aae36da2fdcda167fbdf67 100644
(file)
--- 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);