[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.6] libxl: Do not trust backend in channel list
commit 562ecb38944404a5b329b24b418d87d6e9be50e7 Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> AuthorDate: Wed May 4 16:59:38 2016 +0100 Commit: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> CommitDate: Mon Jun 6 15:08:19 2016 +0100 libxl: Do not trust backend in channel list Read the name from /libxl/device. Pass the /libxl path to libxl__device_channel_from_xenstore. This removes the final route by which READ_LIBXLDEV might receive a backend path. This is part of XSA-178. Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- v2: Remove be_path variable which is now no longer used. --- tools/libxl/libxl.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 8cb5582..41d125f 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -3842,7 +3842,7 @@ static int libxl__append_channel_list(libxl__gc *gc, libxl_device_channel **channels, int *nchannels) { - char *libxl_dir_path = NULL, *be_path = NULL; + char *libxl_dir_path = NULL; char **dir = NULL; unsigned int n = 0, devid = 0; libxl_device_channel *next = NULL; @@ -3859,10 +3859,7 @@ static int libxl__append_channel_list(libxl__gc *gc, libxl_device_channel *tmp; libxl_path = GCSPRINTF("%s/%s", libxl_dir_path, dir[i]); - be_path = libxl__xs_read(gc, XBT_NULL, - GCSPRINTF("%s/backend", libxl_path)); - if (!be_path) continue; - name = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/name", be_path)); + name = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/name", libxl_path)); /* 'channels' are consoles with names, so ignore all consoles without names */ if (!name) continue; @@ -3874,7 +3871,7 @@ static int libxl__append_channel_list(libxl__gc *gc, } *channels = tmp; next = *channels + *nchannels + devid; - rc = libxl__device_channel_from_xenstore(gc, be_path, next); + rc = libxl__device_channel_from_xenstore(gc, libxl_path, next); if (rc) goto out; next->devid = devid; devid++; -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.6 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |