OSDN Git Service

x86/microcode/AMD: Subtract SECTION_HDR_SIZE from file leftover length
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Tue, 19 Jun 2018 18:47:31 +0000 (20:47 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 19 Nov 2018 09:44:59 +0000 (10:44 +0100)
commit479229d1607b6051abc4f9c2ccbb65338f030c65
tree0039e4067bac9eb770881b10befdcaa41e81a73a
parent9ff01193a20d391e8dbce4403dd5ef87c7eaaca6
x86/microcode/AMD: Subtract SECTION_HDR_SIZE from file leftover length

verify_patch_size() verifies whether the remaining size of the microcode
container file is large enough to contain a patch of the indicated size.

However, the section header length is not included in this indicated
size but it is present in the leftover file length so it should be
subtracted from the leftover file length before passing this value to
verify_patch_size().

 [ bp: Split comment. ]

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: x86-ml <x86@kernel.org>
Link: http://lkml.kernel.org/r/6df43f4f6a28186a13a66e8d7e61143c5e1a2324.1529424596.git.mail@maciej.szmigiero.name
arch/x86/kernel/cpu/microcode/amd.c