mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-11 15:40:50 +00:00
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>
This commit is contained in:
parent
de2a47cf2b
commit
506f90eeae
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user