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

[Xen-changelog] [xen master] x86/mm: Add missing copy_from_user error checks in p2m_set_access_multi



commit 424fdc67e90baf543650be2f88e0894afb25494b
Author:     Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
AuthorDate: Wed Sep 21 15:41:04 2016 +0300
Commit:     George Dunlap <george.dunlap@xxxxxxxxxx>
CommitDate: Wed Sep 21 13:59:52 2016 +0100

    x86/mm: Add missing copy_from_user error checks in p2m_set_access_multi
    
    Added missing error checks in p2m_set_mem_access_multi().
    
    CID 1373105 and 1373106
    
    Signed-off-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
    Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index b16e563..9526fff 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1936,8 +1936,12 @@ long p2m_set_mem_access_multi(struct domain *d,
         uint8_t access;
         uint64_t gfn_l;
 
-        copy_from_guest_offset(&gfn_l, pfn_list, start, 1);
-        copy_from_guest_offset(&access, access_list, start, 1);
+        if ( copy_from_guest_offset(&gfn_l, pfn_list, start, 1) ||
+             copy_from_guest_offset(&access, access_list, start, 1) )
+        {
+            rc = -EFAULT;
+            break;
+        }
 
         if ( !xenmem_access_to_p2m_access(p2m, access, &a) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.