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] fix process_portio_intercept

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] fix process_portio_intercept
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 01 Apr 2009 15:19:44 +0100
Delivery-date: Wed, 01 Apr 2009 07:22:58 -0700
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080505)
Hi all,
process_portio_intercept and hvm_mmio_access do not correctly check the
return value of the intercept action functions they are calling.
In particular they are setting p->count to i even if i is 0 and the
action function returned X86EMUL_UNHANDLEABLE, leading to errors.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

diff -r dbc4014882d0 xen/arch/x86/hvm/intercept.c
--- a/xen/arch/x86/hvm/intercept.c      Wed Apr 01 08:36:21 2009 +0100
+++ b/xen/arch/x86/hvm/intercept.c      Wed Apr 01 15:15:29 2009 +0100
@@ -100,8 +100,10 @@
         }
     }
 
-    if ( (p->count = i) != 0 )
+    if ( i > 0 ) {
+        p->count = i;
         rc = X86EMUL_OKAY;
+    }
 
     return rc;
 }
@@ -165,8 +167,10 @@
         }
     }
 
-    if ( (p->count = i) != 0 )
+    if ( i > 0 ) {
+        p->count = i;
         rc = X86EMUL_OKAY;
+    }
 
     return rc;
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix process_portio_intercept, Stefano Stabellini <=