Re: [PATCH] x86/microcode/intel: Allow late loading only if a min rev is specified

From: Ashok Raj
Date: Mon Aug 29 2022 - 14:53:53 EST


On Mon, Aug 29, 2022 at 11:36:12AM -0700, Dave Hansen wrote:
> On 8/29/22 11:04, Ashok Raj wrote:
> > Any microcode that modifies the interface to an OS-visible feature
> > will set the min_version to itself. This will enforce this microcode is
> > not suitable for late loading unless the currently loaded revision is greater
> > or equal to the new microcode affecting the change.
>
> I know this hasn't quite made it into the normal Intel documentation
> channels. But, it would be nice to make sure that we have a _really_
> solid description here of the architecture of min_rev which is *very*
> close to what the Intel folks building microcode images agreed to.
>
> This whole thing is useless if the architecture contract isn't ironclad
> and agreed to by both sides.
>
> One other thing on that note... The CPU itself authenticates the
> microcode. The OS trusts that the CPU will verify the integrity of the
> image.
>
> But, this min_rev is not part of the image that the CPU verifies, right?
> If you get your microcode images out of the back of a van in the shady
> part of town, nobody can promise that min_rev in the header follows the
> rules.
>
> I don't think we need to defend against that. I'm not sure we really
> even *can* defend against it. It's probably good to note, though.

If someone also recomputes checksums in the main-header and also for
extended signature tables when one is present.. just a binary edit will be
caught by the microcode_sanity_check() today.

The commit log already has the following text. It doesn't say this is not
in the encrypted header, but just says HW doesn't check for min-rev.

If you think we should change the description below, I can update it.

------
The enforcement is not in hardware and limited to kernel loader enforcing
the requirement. It is not required for early loading of microcode to
enforce this requirement, since the new features are only
evaluated after early loading in the boot process.