From: Keir Fraser Date: Tue, 20 Jan 2009 16:41:29 +0000 (+0000) Subject: x86, hvm: Limit output debug port to printable characters. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14014^2~41 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1152b4f1389d8ed4b39ec0e0967ba49fc284f1dc;p=xen.git 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 --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 0d13a79a5f..ff531e3ae2 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -20,6 +20,7 @@ */ #include +#include #include #include #include @@ -273,6 +274,10 @@ static int hvm_print_line( 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; if ( (hd->pbuf_idx == (sizeof(hd->pbuf) - 2)) || (c == '\n') )