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-changelog

[Xen-changelog] [xen-unstable] [XEN] Fix read_console_ring() when passed

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Fix read_console_ring() when passed a small buffer.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Jun 2006 10:45:26 +0000
Delivery-date: Mon, 12 Jun 2006 03:47:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 92f071926e6edbd87e83cf117aaeb45cd5775c9b
# Parent  a936c9c3ea60cc0ed8aa712c00a19d377cc76d0f
[XEN] Fix read_console_ring() when passed a small buffer.
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/drivers/char/console.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r a936c9c3ea60 -r 92f071926e6e xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Mon Jun 12 09:57:23 2006 +0100
+++ b/xen/drivers/char/console.c        Mon Jun 12 10:05:55 2006 +0100
@@ -230,7 +230,7 @@ long read_console_ring(XEN_GUEST_HANDLE(
     sofar = 0;
 
     c = conringc;
-    while ( c != conringp )
+    while ( (c != conringp) && (sofar < max) )
     {
         idx = CONRING_IDX_MASK(c);
         len = conringp - c;
@@ -247,7 +247,10 @@ long read_console_ring(XEN_GUEST_HANDLE(
     if ( clear )
     {
         spin_lock_irqsave(&console_lock, flags);
-        conringc = conringp;
+        if ( (conringp - c) > CONRING_SIZE )
+            conringc = conringp - CONRING_SIZE;
+        else
+            conringc = c;
         spin_unlock_irqrestore(&console_lock, flags);
     }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] Fix read_console_ring() when passed a small buffer., Xen patchbot-unstable <=