x86, microcode, AMD: Fix broken ucode patch size check
commit 36bf50d7697be18c6bfd0401e037df10bff1e573 upstream.
This issue was recently observed on an AMD C-50 CPU where a patch of
maximum size was applied.
Commit be62adb49294 ("x86, microcode, AMD: Simplify ucode verification")
added current_size in get_matching_microcode(). This is calculated as
size of the ucode patch + 8 (ie. size of the header). Later this is
compared against the maximum possible ucode patch size for a CPU family.
And of course this fails if the patch has already maximum size.
Signed-off-by: Andreas Herrmann <email@example.com>
Signed-off-by: Borislav Petkov <firstname.lastname@example.org>
Signed-off-by: H. Peter Anvin <email@example.com>
Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>
1 file changed