Re: [PATCH 2/3] x86/microcode/AMD: Make __verify_patch_size() return bool

From: Borislav Petkov
Date: Thu Nov 14 2024 - 09:27:18 EST


On Thu, Nov 14, 2024 at 04:13:33PM +0200, Nikolay Borisov wrote:
> > if (sh_psize != max_size)
> > return false;
>
> Isn't sh_psize < max_size valid here?

* sh_psize < min_t(u32, buf_size, max_size) == max_size -- ditto.

This is still some sort of a mismatch which we'd rather fail.

That max_size should probably be called patch_size or so.

IOW, if the patch size in the header doesn't match the per-family patch size
=> fail.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette