x86/traps: guard top-of-stack reads
authorJan Beulich <jbeulich@suse.com>
Tue, 24 Sep 2019 08:47:53 +0000 (10:47 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 24 Sep 2019 08:47:53 +0000 (10:47 +0200)
commit22c419eec6e037a0f8234be97a5ee057bdc89ee4
treedf88e6cd1063aac4e56369103cb198c8344087c8
parentc4a5656b2ef3d29bb8acfb5342e786a5b9578018
x86/traps: guard top-of-stack reads

Nothing guarantees that the original frame's stack pointer points at
readable memory. Avoid a (likely nested) crash by attaching exception
recovery to the read (making it a single read at the same time). Don't
even invoke _show_trace() in case of a non-readable top slot.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/traps.c