diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2009-10-29 09:45:52 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-09 23:46:09 -0500 |
commit | 506f90eeae682dc96c11c7aefac0262b3a560b49 (patch) | |
tree | f151440e5c91bfdf9957941bd94dc8d7b42e0356 /arch/x86 | |
parent | de2a47cf2b3f59ef9664b277f4021b91af13598e (diff) |
x86, amd-ucode: Check UCODE_MAGIC before loading the container file
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
LKML-Reference: <20091029134552.GC30802@alberich.amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/microcode_amd.c | 6 |
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) | |||
317 | return UCODE_NFOUND; | 317 | return UCODE_NFOUND; |
318 | } | 318 | } |
319 | 319 | ||
320 | if (*(u32 *)firmware->data != UCODE_MAGIC) { | ||
321 | printk(KERN_ERR "microcode: invalid UCODE_MAGIC (0x%08x)\n", | ||
322 | *(u32 *)firmware->data); | ||
323 | return UCODE_ERROR; | ||
324 | } | ||
325 | |||
320 | ret = generic_load_microcode(cpu, firmware->data, firmware->size); | 326 | ret = generic_load_microcode(cpu, firmware->data, firmware->size); |
321 | 327 | ||
322 | release_firmware(firmware); | 328 | release_firmware(firmware); |