[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging-4.10] x86/HVM: __hvm_copy() should not write to p2m_ioreq_server pages



commit 70e728bd44c1365207458a8c71fc68b96a8c515a
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Feb 1 11:42:16 2019 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Feb 1 11:42:16 2019 +0100

    x86/HVM: __hvm_copy() should not write to p2m_ioreq_server pages
    
    Commit 3bdec530a5 ("x86/HVM: split page straddling emulated accesses in
    more cases") introduced a hvm_copy_to_guest_linear() attempt before
    falling back to hvmemul_linear_mmio_write(). This is wrong for the
    p2m_ioreq_server special case. That change widened a pre-existing issue
    though: Other writes to such pages also need to be failed (or forced
    through emulation), in particular hypercall buffer writes.
    
    Reported-by: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: d7bff2bc003cd5fd8c618b70c62b8fcfd9cd187e
    master date: 2018-11-15 16:42:25 +0100
---
 xen/arch/x86/hvm/hvm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 1f8a51fb4a..a61b0cb507 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3237,6 +3237,12 @@ static enum hvm_translation_result __hvm_copy(
         if ( res != HVMTRANS_okay )
             return res;
 
+        if ( (flags & HVMCOPY_to_guest) && p2mt == p2m_ioreq_server )
+        {
+            put_page(page);
+            return HVMTRANS_bad_gfn_to_mfn;
+        }
+
         p = (char *)__map_domain_page(page) + (addr & ~PAGE_MASK);
 
         if ( flags & HVMCOPY_to_guest )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.10

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.