xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Gianni Tedesco <gianni.tedesco@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Xen Devel <xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH]: fix segfault in xl destroy when xenstore has been fowled up
Date: Tue, 20 Jul 2010 18:32:30 +0100	[thread overview]
Message-ID: <1279647150.1723.1981.camel@qabil.uk.xensource.com> (raw)
In-Reply-To: <19525.52837.149559.660268@mariner.uk.xensource.com>

Oops, forgot signed off by and change subject

8<---------------------
Fix segfault in xl destroy when xenstore has been fowled up

libxl_dirname() returns NULL if a string is passed to it which doesn't
look like a xenstore key. During xl destroy libxl_dirname is used to
generate an xs path in order to remove device backend keys. If a
nonsense key has been put in there resulting in NULL backend path this
will crash xl.

Signed-off-by: <gianni.tedesco@citrix.com>

diff -r 1eea12f66951 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Tue Jul 20 17:14:43 2010 +0100
+++ b/tools/libxl/libxl_device.c	Tue Jul 20 18:05:19 2010 +0100
@@ -344,7 +344,8 @@ int libxl_devices_destroy(struct libxl_c
     }
     for (i = 0; i < n; i++) {
         flexarray_get(toremove, i, (void**) &path);
-        xs_rm(clone.xsh, XBT_NULL, path);
+        if ( path )
+            xs_rm(clone.xsh, XBT_NULL, path);
     }
     flexarray_free(toremove);
     libxl_ctx_free(&clone);

  parent reply	other threads:[~2010-07-20 17:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20 15:55 [PATCH]: fix crash in various tools by permitting xs_*() with NULL path Gianni Tedesco
2010-07-20 16:27 ` Ian Jackson
2010-07-20 17:02   ` Gianni Tedesco
2010-07-26  9:45     ` Paolo Bonzini
2010-07-20 17:16   ` Gianni Tedesco
2010-07-20 17:32   ` Gianni Tedesco [this message]
2010-07-21 13:48     ` [PATCH]: fix segfault in xl destroy when xenstore has been fowled up Stefano Stabellini
2010-07-21 13:59       ` Ian Jackson
2010-07-21  8:41   ` [PATCH]: fix crash in various tools by permitting xs_*() with NULL path Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279647150.1723.1981.camel@qabil.uk.xensource.com \
    --to=gianni.tedesco@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).