linux-stable/arch/x86/kernel/cpu/microcode
Jann Horn 7e94a7b659 x86/microcode/intel: Refactor Intel microcode blob loading
Change generic_load_microcode() to use the iov_iter API instead of a
clumsy open-coded version which has to pay attention to __user data
or kernel data, depending on the loading method. This allows to avoid
explicit casting between user and kernel pointers.

Because the iov_iter API makes it hard to read the same location twice,
as a side effect, also fix a double-read of the microcode header (which
could e.g. lead to out-of-bounds reads in microcode_sanity_check()).

Not that it matters much, only root is allowed to load microcode
anyway...

 [ bp: Massage a bit, sort function-local variables. ]

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190404111128.131157-1-jannh@google.com
2019-04-10 22:40:25 +02:00
..
amd.c x86/microcode/amd: Don't falsely trick the late loading mechanism 2019-01-31 16:54:32 +01:00
core.c x86/microcode: Announce reload operation's completion 2019-03-21 12:24:39 +01:00
intel.c x86/microcode/intel: Refactor Intel microcode blob loading 2019-04-10 22:40:25 +02:00
Makefile x86/microcode/intel: Remove intel_lib.c 2016-10-25 12:28:59 +02:00