[coreboot-gerrit] Patch set updated for coreboot: dc322e6 Intel: Return on missing microcode file to fix null pointer dereference

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Sat Mar 30 23:38:44 CET 2013

Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2990


commit dc322e66370034efefb830df83e5ce78a08b1d88
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Sat Mar 30 12:04:23 2013 +0100

    Intel: Return on missing microcode file to fix null pointer dereference
    Selecting `CPU_MICROCODE_IN_CBFS` in Kconfig but not having the
    microcode blob `cpu_microcode_blob.bin` in CBFS results in a
    null pointer dereference later on resulting in a crash.
    for(c = microcode_updates; m->hdrver; m = (const struct microcode *)c) {
    Fix this by returning if `microcode_updates` is `NULL`, that means
    no file is found.
    This patch is successfully tested on the Lenovo X201.
    Change-Id: I6e18fd37256910bf047061e4633a66cf29ad7b69
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
    Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
 src/cpu/intel/microcode/microcode.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/cpu/intel/microcode/microcode.c b/src/cpu/intel/microcode/microcode.c
index d908c25..82ab7a2 100644
--- a/src/cpu/intel/microcode/microcode.c
+++ b/src/cpu/intel/microcode/microcode.c
@@ -130,6 +130,9 @@ const void *intel_microcode_find(void)
+	/* No need for explicit error message since the user already gets
+	   "file not found" from cbfs.
+	 */
 	if (!microcode_updates)
 		return microcode_updates;
@@ -202,6 +205,9 @@ void intel_update_microcode(const void *microcode_updates)
 	const char *c;
 	msr_t msr;
+	if (!microcode_updates)
+		return;
 	/* CPUID sets MSR 0x8B iff a microcode update has been loaded. */
 	msr.lo = 0;
 	msr.hi = 0;

More information about the coreboot-gerrit mailing list