提交 506f90ee 编写于 作者: B Borislav Petkov 提交者: Ingo Molnar

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

Signed-off-by: NBorislav Petkov <borislav.petkov@amd.com>
Signed-off-by: NAndreas Herrmann <andreas.herrmann3@amd.com>
LKML-Reference: <20091029134552.GC30802@alberich.amd.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册