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] Re: [Xen-changelog] Correct buffer->size at the same time as

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [Xen-changelog] Correct buffer->size at the same time as buffer->capacity when shrinking down a
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Thu, 17 Nov 2005 11:38:05 -0600
Cc: Dan Smith <danms@xxxxxxxxxx>
Delivery-date: Thu, 17 Nov 2005 17:38:08 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E1EcmDE-000875-Pm@xxxxxxxxxxxxxxxxxxxxx>
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>
References: <E1EcmDE-000875-Pm@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
Thanks Ewan, Dan and I were banging our heads on this one.

Good Catch!

Regards,

Anthony Liguori

Xen patchbot -unstable wrote:

# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 418954da5c0f58bc856893f3850b0d97deb143ec
# Parent  3f39f030fa894d29d04b748513bf48000d6a17f5
Correct buffer->size at the same time as buffer->capacity when shrinking down a
buffer that has grown beyond max_capacity.  This fixes a Xenconsoled segfault
that was caused by stomping around above the buffer's allocated region.  It
became possible to set the max_capacity with changeset 7431, and ever
since then we have been exposed to this bug.  It would most easily be triggered
by running a domain without a client attached to the console, so that the
max_capacity was reached more easily.

Closes bug #380.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 3f39f030fa89 -r 418954da5c0f tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Wed Nov 16 19:33:23 2005
+++ b/tools/console/daemon/io.c Thu Nov 17 11:59:12 2005
@@ -114,7 +114,7 @@
                        buffer->data, buffer->max_capacity);
                buffer->data = realloc(buffer->data,
                                       buffer->max_capacity);
-               buffer->capacity = buffer->max_capacity;
+               buffer->size = buffer->capacity = buffer->max_capacity;
        }
}


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



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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Re: [Xen-changelog] Correct buffer->size at the same time as buffer->capacity when shrinking down a, Anthony Liguori <=