Messages in this thread Patch in this message | | | Date | Wed, 20 Jun 2012 01:38:11 +0200 | From | Borislav Petkov <> | 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
| |