x86/MCE: avoid leaking stack data
authorJan Beulich <jbeulich@suse.com>
Thu, 9 Jan 2020 10:08:29 +0000 (11:08 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Jan 2020 10:08:29 +0000 (11:08 +0100)
commit9fdad93087e04cb3a155c62344eb88149e1cfc4a
treea1cedcd130a0fc77e19673df1ea1e7c51e576b33
parent774901788c5614798931a1cb2e20dd8b885f97ab
x86/MCE: avoid leaking stack data

While HYPERVISOR_mca is a privileged operation, we still shouldn't leak
stack contents (the tail of every array entry's mc_msrvalues[] of
XEN_MC_physcpuinfo output). Simply use a zeroing allocation here.

Take the occasion and also restrict the involved local variable's scope.

Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/cpu/mcheck/mce.c