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/
Home Products Support Community News


Re: [Xen-devel] [PATCH] Uninitialized ifname can cause qemu to quit

To: "Steve Dobbelstein" <steved@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Uninitialized ifname can cause qemu to quit
From: "Christian Limpach" <christian.limpach@xxxxxxxxx>
Date: Thu, 27 Jul 2006 11:22:02 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 27 Jul 2006 03:22:25 -0700
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eYCzAX20OShni5UsEY4P0Z739EJPVC/Sx9N5AWm+SjOf/t8saB/eR+WkeCChV6m1Mmw4skz9VMVwrfECgtvJt0zNtU1nzCUmIruca4pmpmGFCVAkb9aH4jNpCw+1+BWwmK520PHruJikRnvwKpCM1U/oj2aQPv2tp5mWiJhWaCk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <OF15E29D19.66F4FC36-ON052571B7.00525DD8-052571B7.0055F63A@xxxxxxxxxx>
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: <OF15E29D19.66F4FC36-ON052571B7.00525DD8-052571B7.0055F63A@xxxxxxxxxx>
Reply-to: Christian.Limpach@xxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On 7/26/06, Steve Dobbelstein <steved@xxxxxxxxxx> wrote:

Posting an updated version of the patch (fix the #ifdef _WIN32 case, as
well), this time with a signed-off-by line.

I've applied a subset of this patch.  The _WIN32 code is already
correct and script/bridge missing is already handled correctly.


Signed-off-by: Steve Dobbelstein <steved@xxxxxxxxxx>


Uninitialized ifname can cause qemu to quit.  If the first character of the
ifname is not \0, qemu will think that the junk in ifname is valid and
will configure /dev/net/tun to use it.  The configuration fails and qemu

--- a/tools/ioemu/vl.c  2006-07-17 10:25:07.000000000 -0500
+++ b/tools/ioemu/vl.c  2006-07-26 09:43:32.000000000 -0500
@@ -3266,6 +3266,7 @@
 #ifdef _WIN32
     if (!strcmp(device, "tap")) {
         char ifname[64];
+        ifname[0] = '\0';
         if (get_param_value(ifname, sizeof(ifname), "ifname", p) <= 0) {
             fprintf(stderr, "tap: no interface name\n");
             return -1;
@@ -3278,6 +3279,7 @@
         char setup_script[1024];
         char bridge[16];
         int fd;
+        ifname[0] = setup_script[0] = bridge[0] = '\0';
         if (get_param_value(buf, sizeof(buf), "fd", p) > 0) {
             fd = strtol(buf, NULL, 0);
             ret = -1;

(See attached file: qemu-ifname.patch)

Xen-devel mailing list

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>