[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120619233810.GI5996@aftab.osrc.amd.com>
Date: Wed, 20 Jun 2012 01:38:11 +0200
From: Borislav Petkov <bp@...64.org>
To: "Yu, Fenghua" <fenghua.yu@...el.com>
Cc: X86-ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
Andreas Herrmann <andreas.herrmann3@....com>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 1/2] x86, microcode: Sanitize per-cpu microcode reloading
interface
On Tue, Jun 19, 2012 at 11:15:56PM +0000, Yu, Fenghua wrote:
> > diff --git a/arch/x86/kernel/microcode_core.c
> > b/arch/x86/kernel/microcode_core.c
> > index fbdfc6917180..24b852b61be3 100644
> > --- a/arch/x86/kernel/microcode_core.c
> > +++ b/arch/x86/kernel/microcode_core.c
> > @@ -298,19 +298,31 @@ static ssize_t reload_store(struct device *dev,
> > const char *buf, size_t size)
> > {
> > unsigned long val;
> > - int cpu = dev->id;
> > - ssize_t ret = 0;
> > + int cpu;
> > + ssize_t ret = 0, tmp_ret;
> > +
> > + /* allow reload only from the BSP */
> > + if (boot_cpu_data.cpu_index != dev->id)
> > + return -EINVAL;
>
> With the /sys/devices/system/cpu/microcode/reload interface in your
> patch 2/2, this will be broken, right?
Actually it works per chance and passed testing. And I think I know why:
now the reload sysfs node is not per-cpu, this dev->id is always 0 and
thus the check passes.
> With the new interface, reload_store() can be executed on any cpu or
> dev. I think you need to remove this check if working with the patch
> 2/2.
But you're right, will fix.
Thanks for the review.
--
Regards/Gruss,
Boris.
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists