x86/microcode/AMD: Check the equivalence table size when scanning it
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Thu, 13 Sep 2018 10:01:52 +0000 (12:01 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 19 Nov 2018 09:55:12 +0000 (10:55 +0100)
commit413c89154c6759cbd5e17febd04c187470613173
tree8b15a4dddb1fad3daf22f9324b74cb0dccbeeb57
parent39cd7c17f9bc3fe3737dacd4225eeabe56df197c
x86/microcode/AMD: Check the equivalence table size when scanning it

Currently, the code scanning the CPU equivalence table read from a
microcode container file assumes that it actually contains a terminating
zero entry.

Check also the size of this table to make sure that no reads past its
end happen, in case there's no terminating zero entry at the end of the
table.

 [ bp: Adjust to new changes. ]

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-16-bp@alien8.de
arch/x86/kernel/cpu/microcode/amd.c