Re: [PATCH 13/13] x86/microcode/intel: Fix printing of microcode blobs in show_saved_mc()

From: Borislav Petkov
Date: Wed Feb 25 2015 - 12:57:03 EST


On Wed, Feb 25, 2015 at 10:41:25AM +0100, Quentin Casasnovas wrote:
> Yup that's how I understood your patchset :) If I may though, I think the
> issue I raised on your patch 8 is serious enough to get a fix before you
> merge this patchset - it should just be a matter of adding some parentheses
> at the correct place, and should be a good candidate for -stable.

Right, so ext_sig is already correct because (void *) arithmetic is a
gnu extension and works as expected when doing char ptr arithmetic. So
the minimal fix should be this:

---
diff --git a/arch/x86/kernel/cpu/microcode/intel_early.c b/arch/x86/kernel/cpu/microcode/intel_early.c
index 079d8d41fba3..860006e3b5c1 100644
--- a/arch/x86/kernel/cpu/microcode/intel_early.c
+++ b/arch/x86/kernel/cpu/microcode/intel_early.c
@@ -158,7 +158,7 @@ matching_model_microcode(struct microcode_header_intel *mc_header,
if (total_size <= data_size + MC_HEADER_SIZE)
return UCODE_NFOUND;

- ext_header = (struct extended_sigtable *)mc_header + data_size + MC_HEADER_SIZE;
+ ext_header = (void *)mc_header + data_size + MC_HEADER_SIZE;
ext_sig = (void *)ext_header + EXT_HEADER_SIZE;
ext_sigcount = ext_header->count;

---

Now, since you spotted it, if you sent me a patch *not* ontop of my
patchset but ontop of 4.0-rc1, I'll gladly take it and prepend my
patchset with it.

> I have also very limited time to allocate for this, but I can surely
> help with reviewing. If I manage to get some spare time, I'll make
> sure to try to contribute as well, no guarantee for now though!

Ok, sure, absolutely. I'm already happy with people even looking at it
and poking holes. :-)

Thanks.

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/