WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][VT]Add some sanity check when creating 3 level 1:1 p

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][VT]Add some sanity check when creating 3 level 1:1 page table
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Wed, 14 Sep 2005 18:18:20 +0800
Delivery-date: Wed, 14 Sep 2005 10:16:11 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcW5FaHBQBFP4NCcRIKXiSAN/gRL/w==
Thread-topic: [PATCH][VT]Add some sanity check when creating 3 level 1:1 page table
This patch add some check zap_mmio_range when create 3 level 1:1 page
table.

Thanks
Yunhong Jiang

# HG changeset patch
# User yjiang5@xxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 5fd22c273f2c6e93b08ae9da2c8202b3d275f30d
# Parent  bc3ad53b98688df03679bafec3c03ee2b5bcc10f
Add some sanity check when creating 3 level 1:1  page table.

Add check for empty l2e page entry.
Add check for faile vl1tab map.

Signed-off-by: Yunhong Jiang <yunhong.jiang@xxxxxxxxx>
Signed-off-by: Asit Mallick <asit.k.mallick@xxxxxxxxx>

diff -r bc3ad53b9868 -r 5fd22c273f2c tools/libxc/xc_vmx_build.c
--- a/tools/libxc/xc_vmx_build.c        Wed Sep 14 10:03:10 2005
+++ b/tools/libxc/xc_vmx_build.c        Wed Sep 14 10:03:16 2005
@@ -188,6 +188,8 @@
  
    mmio_addr = mmio_range_start & PAGE_MASK;
    for (; mmio_addr < mmio_range_end; mmio_addr += PAGE_SIZE) {
+       vl2tab = NULL;
+       vl1tab = NULL;
        vl3e = vl3tab[l3_table_offset(mmio_addr)];
        if (vl3e == 0)
            continue;
@@ -198,10 +200,19 @@
            return -1;
        }
        vl2e = vl2tab[l2_table_offset(mmio_addr)];
-       if (vl2e == 0)
+       if (vl2e == 0){
+           if(vl2tab)
+               munmap(vl2tab, PAGE_SIZE);
            continue;
+       }
        vl1tab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
                PROT_READ|PROT_WRITE, vl2e >> PAGE_SHIFT);
+
+       if (vl1tab == 0) {
+           PERROR("Failed zap MMIO range");
+           munmap(vl2tab, PAGE_SIZE);
+           return -1;
+       }
 
        vl1tab[l1_table_offset(mmio_addr)] = 0;
        munmap(vl2tab, PAGE_SIZE);

Attachment: check.diff
Description: check.diff

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][VT]Add some sanity check when creating 3 level 1:1 page table, Jiang, Yunhong <=