x86/setup: Avoid OoB E820 lookup when calculating the L1TF safe address
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 14 Sep 2018 11:04:07 +0000 (13:04 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 14 Sep 2018 11:04:07 +0000 (13:04 +0200)
commita07f444502ad8358e019cf0ae37a3e4b205467b4
tree95aee4da784b57e36f7a9647ad27c00de374a7e2
parent74fee1b6d35a257f58a38d320bcc72d9efc7d413
x86/setup: Avoid OoB E820 lookup when calculating the L1TF safe address

A number of corner cases (most obviously, no-real-mode and no Multiboot memory
map) can end up with e820_raw.nr_map being 0, at which point the L1TF
calculation will underflow.

Spotted by Coverity.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
master commit: 3e4ec07e14bce81f6ae22c31ff1302d1f297a226
master date: 2018-08-16 18:10:07 +0100
xen/arch/x86/setup.c