Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754074AbZJ2Nwh (ORCPT ); Thu, 29 Oct 2009 09:52:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753813AbZJ2Nwg (ORCPT ); Thu, 29 Oct 2009 09:52:36 -0400 Received: from mail-ew0-f209.google.com ([209.85.219.209]:61913 "EHLO mail-ew0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753809AbZJ2Nwg (ORCPT ); Thu, 29 Oct 2009 09:52:36 -0400 X-Greylist: delayed 404 seconds by postgrey-1.27 at vger.kernel.org; Thu, 29 Oct 2009 09:52:35 EDT DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=q7RUyiMf/jBqFhLQEJEy/TUKlb7vYUX5gWWjuIYnQjcK/hfCROnG+nSY1J0fmlkRxc RSUwYabefeLPoS0va7Hidyjh1/gfyjJ62DaQieLGWCzU73rwdHO8urh572SLUqG+QBfH 0scKJ+xnr7UZyBcDuuOtVbw3Alv9lqGIPnwrM= Date: Thu, 29 Oct 2009 14:45:52 +0100 From: Andreas Herrmann To: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org, Borislav Petkov Subject: [PATCH 1/2] x86, amd-ucode: Check UCODE_MAGIC before loading the container file Message-ID: <20091029134552.GC30802@alberich.amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1314 Lines: 36 >From 5183dd763c6dc9f760e29f3313e0ae3dda5228a2 Mon Sep 17 00:00:00 2001 From: Borislav Petkov 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 Signed-off-by: Andreas Herrmann --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/