From: Ian Jackson Date: Wed, 4 May 2016 14:57:10 +0000 (+0100) Subject: libxl: Do not trust backend for channel in getinfo X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1044 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b3a4560e96a654927a70722aad6a5f68ea2da3e8;p=xen.git libxl: Do not trust backend for channel in getinfo Do not read the frontend path out of the backend. We have it in our hand. Likewise the guest (frontend) domid was one of our parameters (!) This is part of XSA-178. Signed-off-by: Ian Jackson Reviewed-by: Wei Liu --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 382013724a..4193c9c270 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -4066,12 +4066,8 @@ int libxl_device_channel_getinfo(libxl_ctx *ctx, uint32_t domid, val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/state", fe_path)); channelinfo->state = val ? strtoul(val, NULL, 10) : -1; - channelinfo->frontend = xs_read(ctx->xsh, XBT_NULL, - GCSPRINTF("%s/frontend", - channelinfo->backend), NULL); - val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/frontend-id", - channelinfo->backend)); - channelinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1; + channelinfo->frontend = libxl__strdup(NOGC, fe_path); + channelinfo->frontend_id = domid; val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/ring-ref", fe_path)); channelinfo->rref = val ? strtoul(val, NULL, 10) : -1; val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/port", fe_path));