mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxl: Do not trust backend for disk 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 <Ian.Jackson@eu.citrix.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
04e7c06b92
commit
1e213d5068
1 file changed
+2
-3
+2
-3
@@ -2440,9 +2440,8 @@ int libxl_device_disk_getinfo(libxl_ctx *ctx, uint32_t domid,
|
||||
val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/ring-ref", fe_path));
|
||||
diskinfo->rref = val ? strtoul(val, NULL, 10) : -1;
|
||||
diskinfo->frontend = xs_read(ctx->xsh, XBT_NULL,
|
||||
libxl__sprintf(gc, "%s/frontend", diskinfo->backend), NULL);
|
||||
val = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s/frontend-id", diskinfo->backend));
|
||||
diskinfo->frontend_id = val ? strtoul(val, NULL, 10) : -1;
|
||||
GCSPRINTF("%s/frontend", libxl_path), NULL);
|
||||
diskinfo->frontend_id = domid;
|
||||
|
||||
GC_FREE;
|
||||
return 0;
|
||||
|
||||