From: Marek Marczykowski <marmarek@invisiblethingslab.com>
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: xl network-attach SEGV in 4.2 and 4.1
Date: Wed, 17 Apr 2013 04:49:51 +0200 [thread overview]
Message-ID: <516E0DCF.9090001@invisiblethingslab.com> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
4.2 and 4.1 suffers from SEGV during xl network-attach in
libxl__device_nic_add. In 4.3-unstable it is fixed by:
5420f2650 libxl: Set vfb and vkb devid if not done so by the caller
So either the patch need to be backported to 4.1 and 4.2, or fixed by this one:
- ------
libxl: Fix SEGV in network-attach
When "device/vif" directory exists but is empty l!=NULL, but nb==0, so
l[nb-1] is invalid. Add missing check.
Signed-Off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 5783cd2..9e06a7d 100644
- --- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2569,7 +2569,8 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t
domid,
goto out_free;
}
if (!(l = libxl__xs_directory(gc, XBT_NULL,
- - libxl__sprintf(gc, "%s/device/vif",
dompath), &nb))) {
+ libxl__sprintf(gc, "%s/device/vif",
dompath), &nb)) ||
+ nb == 0) {
nic->devid = 0;
} else {
nic->devid = strtoul(l[nb - 1], NULL, 10) + 1;
- --
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/
iQEcBAEBAgAGBQJRbg3PAAoJENuP0xzK19cs0qQH/2mR6lUwj75tKCckFJfM7HPJ
6YEqDvdunmCXr7Wcf9p+Z6RRsnjie9ihDwxbaP4b5XYMLW59YbvZEb3tyrIADYJy
gGwE+8xn3Jx0NjiRCJF5O2nF3w9I5W9o5sUMbXporo/Tu4X0e3PJ6wb1JseZWsLL
mVl3bjwIChos6eKsAKOuHIPqFCASsKIGJibrkWva9LqQ4k/xgjTshCgmbAgEITEo
8fAZbTRL/SM91qX5a+2ynUf/0h5Sb/IvLyLwm86n1wsqLoJ261VMgAOsXxYGUTBM
Pr5Gvc+s5VdhA0iY4IYE8GuQ99MnaXO6T+JSenpfJ3L26LSMvHkImFLqI3ljhzE=
=FWNX
-----END PGP SIGNATURE-----
next reply other threads:[~2013-04-17 2:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-17 2:49 Marek Marczykowski [this message]
2013-04-17 8:43 ` xl network-attach SEGV in 4.2 and 4.1 Ian Campbell
2013-04-18 16:01 ` Ian Jackson
2013-04-18 18:58 ` Roger Pau Monné
2013-11-12 17:23 ` [PATCH RESEND] libxl: Avoid realloc(, 0) when libxl__xs_directory returns empty list Ian Jackson
2013-11-12 17:31 ` Ian Campbell
2013-11-12 17:57 ` Ian Jackson
2013-11-25 13:55 ` Ian Jackson
2013-04-18 16:46 ` xl network-attach SEGV in 4.2 and 4.1 [and 1 more messages] Ian Jackson
2013-04-19 7:12 ` Jan Beulich
2013-04-22 9:49 ` Ian Jackson
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=516E0DCF.9090001@invisiblethingslab.com \
--to=marmarek@invisiblethingslab.com \
--cc=xen-devel@lists.xen.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.