Linux/linux 78ce241arch/x86/kernel/cpu/mcheck mce_amd.c

x86/MCE/AMD: Cache SMCA MISC block addresses

... into a global, two-dimensional array and service subsequent reads from
that cache to avoid rdmsr_on_cpu() calls during CPU hotplug (IPIs with IRQs
disabled).

In addition, this fixes a KASAN slab-out-of-bounds read due to wrong usage
of the bank->blocks pointer.

Fixes: 27bd59502702 ("x86/mce/AMD: Get address from already initialized block")
Reported-by: Johannes Hirte <johannes.hirte at datenkhaos.de>
Tested-by: Johannes Hirte <johannes.hirte at datenkhaos.de>
Signed-off-by: Borislav Petkov <bp at suse.de>
Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
Cc: Yazen Ghannam <yazen.ghannam at amd.com>
Link: http://lkml.kernel.org/r/20180414004230.GA2033@probook
DeltaFile
+14-15arch/x86/kernel/cpu/mcheck/mce_amd.c
+14-151 files

UnifiedSplitRaw