Commit 506f90ee authored by Borislav Petkov's avatar Borislav Petkov Committed by Ingo Molnar
Browse files

x86, amd-ucode: Check UCODE_MAGIC before loading the container file


Signed-off-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
LKML-Reference: <20091029134552.GC30802@alberich.amd.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent de2a47cf
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment