x86/ept: atomically modify entries in ept_next_level
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 7 Jul 2020 13:20:36 +0000 (15:20 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 7 Jul 2020 13:20:36 +0000 (15:20 +0200)
commit7def72c0de00b4f833da4896fd5f07ecec5c3fa9
tree722c2dfafb80acb045275107f49d8015abe6cc95
parent18be3aabd83fa9f683e8ddb0bca2066dd302c20e
x86/ept: atomically modify entries in ept_next_level

ept_next_level was passing a live PTE pointer to ept_set_middle_entry,
which was then modified without taking into account that the PTE could
be part of a live EPT table. This wasn't a security issue because the
pages returned by p2m_alloc_ptp are zeroed, so adding such an entry
before actually initializing it didn't allow a guest to access
physical memory addresses it wasn't supposed to access.

This is part of XSA-328.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: bc3d9f95d661372b059a5539ae6cb1e79435bb95
master date: 2020-07-07 14:37:12 +0200
xen/arch/x86/mm/p2m-ept.c