lkml.org 
[lkml]   [2009]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:x86/urgent] x86, amd-ucode: Check UCODE_MAGIC before loading the container file
Commit-ID:  506f90eeae682dc96c11c7aefac0262b3a560b49
Gitweb: http://git.kernel.org/tip/506f90eeae682dc96c11c7aefac0262b3a560b49
Author: Borislav Petkov <borislav.petkov@amd.com>
AuthorDate: Thu, 29 Oct 2009 14:45:52 +0100
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 10 Nov 2009 05:46:09 +0100

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>
---
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 366baa1..f4c538b 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)
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);

\
 
 \ /
  Last update: 2009-11-10 05:55    [W:0.575 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site