x86: fix ioreq-server event channel vulnerability
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 25 Jul 2014 09:51:57 +0000 (11:51 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Jul 2014 09:51:57 +0000 (11:51 +0200)
commit125833f5f1f0403611bc762b3f1309bada138c54
treeb2af8f3c5df1d487a8b36b204fd010fd19a12f07
parent5be3f335e0d0dd1e449cdd23be3c37366c114b86
x86: fix ioreq-server event channel vulnerability

The code in hvm_send_assist_req_to_ioreq_server() and hvm_do_resume() uses
an event channel port number taken from the page of memory shared with the
emulator. This allows an emulator to corrupt values that are then blindly
used by Xen, leading to assertion failures in some cases. Moreover, in the
case of the default ioreq server the page remains in the guest p2m so a
malicious guest could similarly corrupt those values.

This patch changes the afforementioned functions to get the event channel
port number from an internal structure and also adds an extra check to
hvm_send_assist_req_to_ioreq_server() which will crash the domain should the
guest or an emulator corrupt the port number in the shared page.

Reported-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
xen/arch/x86/hvm/hvm.c