x86/MCE/AMD: Cache SMCA MISC block addresses
authorBorislav Petkov <[email protected]>
Thu, 17 May 2018 08:46:26 +0000 (10:46 +0200)
committerThomas Gleixner <[email protected]>
Sat, 19 May 2018 13:19:30 +0000 (15:19 +0200)
commit78ce241099bb363b19dbd0245442e66c8de8f567
tree735340ca194fc1472f9671f4012fae06b3ce93f5
parent73fcb1a370c76b202d406e95d9dabb76eaccf484
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 <[email protected]>
Tested-by: Johannes Hirte <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Yazen Ghannam <[email protected]>
Link: http://lkml.kernel.org/r/20180414004230.GA2033@probook
arch/x86/kernel/cpu/mcheck/mce_amd.c