mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
7e42cb64bc
commit
35fe0d6663
1 file changed
+2
-4
+2
-4
@@ -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:
|
||||
|
||||