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

[Xen-changelog] [xen-unstable] x86, hvm: Limit output debug port to printable characters.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1232469689 0
# Node ID a0dddcbd9e32279cfa2b2835beb002b25eb94d46
# Parent  adee46c3fbfa3738db50e9e93487435ef249818d
x86, hvm: Limit output debug port to printable characters.

In particular, '\r' was causing output corruption, and it's not
actually needed.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c |    5 +++++
 1 files changed, 5 insertions(+)

diff -r adee46c3fbfa -r a0dddcbd9e32 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Tue Jan 20 15:10:28 2009 +0000
+++ b/xen/arch/x86/hvm/hvm.c    Tue Jan 20 16:41:29 2009 +0000
@@ -20,6 +20,7 @@
  */
 
 #include <xen/config.h>
+#include <xen/ctype.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/trace.h>
@@ -272,6 +273,10 @@ static int hvm_print_line(
     char c = *val;
 
     BUG_ON(bytes != 1);
+
+    /* Accept only printable characters, newline, and horizontal tab. */
+    if ( !isprint(c) && (c != '\n') && (c != '\t') )
+        return X86EMUL_OKAY;
 
     spin_lock(&hd->pbuf_lock);
     hd->pbuf[hd->pbuf_idx++] = c;

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


 


Rackspace

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