lkml.org 
[lkml]   [2009]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH 1/2] x86, amd-ucode: Check UCODE_MAGIC before loading the container file
    Hi Ingo,

    On Sun, Nov 08, 2009 at 01:04:18PM +0100, Ingo Molnar wrote:
    > hm, there's no changelog. How was it found,

    code staring :)

    > what's the significance,

    required by design.

    > do we want it for .32 - i suspect we want - but we need a better
    > changelog for that.

    Yes. How's that?

    --
    From f41bced57e05c8adc0d2c13864b6323c191d45d2 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] x86, amd-ucode: Check UCODE_MAGIC before loading the container file

    When loading a microcode binary, we should check the microcode magic
    value embedded in the image before continuing loading. The original
    check got lost somehow so re-add it to the firmware requesting path.

    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

    --
    Regards/Gruss,
    Boris.


    \
     
     \ /
      Last update: 2009-11-08 15:13    [W:2.938 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site