x86/HVM: restrict HVMOP_set_mem_type
authorJan Beulich <jbeulich@suse.com>
Tue, 29 Apr 2014 13:11:31 +0000 (15:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Apr 2014 13:11:31 +0000 (15:11 +0200)
commit83bb5eb4d340acebf27b34108fb1dae062146a68
tree2849d202b830e4b2af1d49d9b5e33c92b2d947fe
parent31ee951a3bee6e7cc21f94f900fe989e3701a79a
x86/HVM: restrict HVMOP_set_mem_type

Permitting arbitrary type changes here has the potential of creating
present P2M (and hence EPT/NPT/IOMMU) entries pointing to an invalid
MFN (INVALID_MFN truncated to the respective hardware structure field's
width). This would become a problem the latest when something real sat
at the end of the physical address space; I'm suspecting though that
other things might break with such bogus entries.

Along with that drop a bogus (and otherwise becoming stale) log
message.

Afaict the similar operation in p2m_set_mem_access() is safe.

This is XSA-92.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/hvm.c