diff options
author | Jann Horn <jannh@google.com> | 2019-04-04 13:11:28 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2019-04-10 22:40:25 +0200 |
commit | 7e94a7b659eefedda82cde97229a26f319fb1182 (patch) | |
tree | 2a2ecc5eb53754522f0c3112bb6626c3f23ed13e /tools/perf/scripts/python/event_analyzing_sample.py | |
parent | 79a3aaa7b82e3106be97842dedfd8429248896e6 (diff) |
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
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions