All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86, amd-ucode: Check UCODE_MAGIC before loading the container file
@ 2009-10-29 13:45 Andreas Herrmann
  2009-10-29 13:47 ` [PATCH 2/2] x86, amd-ucode: Remove needless log messages Andreas Herrmann
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andreas Herrmann @ 2009-10-29 13:45 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin
  Cc: linux-kernel, Borislav Petkov

>From 5183dd763c6dc9f760e29f3313e0ae3dda5228a2 Mon Sep 17 00:00:00 2001
From: Borislav Petkov <borislav.petkov@amd.com>
Date: Thu, 29 Oct 2009 14:00:54 +0100
Subject: [PATCH 1/2] 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>
---
 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);
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-11-10  5:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29 13:45 [PATCH 1/2] x86, amd-ucode: Check UCODE_MAGIC before loading the container file Andreas Herrmann
2009-10-29 13:47 ` [PATCH 2/2] x86, amd-ucode: Remove needless log messages Andreas Herrmann
2009-11-08 14:57   ` Ingo Molnar
2009-11-09 13:35     ` Andreas Herrmann
2009-11-10  5:15   ` [tip:x86/microcode] " tip-bot for Andreas Herrmann
2009-11-08 12:04 ` [PATCH 1/2] x86, amd-ucode: Check UCODE_MAGIC before loading the container file Ingo Molnar
2009-11-08 14:10   ` Borislav Petkov
2009-11-08 14:55     ` Ingo Molnar
2009-11-10  4:51 ` [tip:x86/urgent] " tip-bot for Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.