libxl: Do not trust backend in nic getinfo

This is part of XSA-178.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Ian Jackson authored and Ian Jackson committed 2016-06-06 16:24:41 +01:00
1 parent 7e42cb64bc
commit 35fe0d6663
1 file changed
+2 -4
+2 -4
View File
@@ -3198,10 +3198,8 @@ int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
nicinfo->rref_tx = val ? strtoul(val, NULL, 10) : -1;
val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/rx-ring-ref", nicpath));
nicinfo->rref_rx = val ? strtoul(val, NULL, 10) : -1;
nicinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
libxl__sprintf(gc, "%s/frontend", nicinfo->backend), NULL);
val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend-id", nicinfo->backend));
nicinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
nicinfo->frontend = libxl__strdup(NOGC, nicpath);
nicinfo->frontend_id = domid;
rc = 0;
out:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.