[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.3] libxl: Do not trust backend for vtpm in getinfo (uuid)



commit 424d83ea2a32c92c6b645c31bee90df1401667a7
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Fri Apr 29 16:57:14 2016 +0100
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Mon Jun 6 17:11:28 2016 +0100

    libxl: Do not trust backend for vtpm in getinfo (uuid)
    
    Use uuid from /libxl, rather than from backend.  I think the backend
    is not supposed to change the uuid, since it seems to be set by libxl
    during setup.
    
    If in fact the backend is supposed to be able to change the uuid, this
    patch needs to be dropped and replaced by a patch which makes the vtpm
    uuid lookup tolerate bad or missing data.
    
    This is part of XSA-178.
    
    Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
    Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 6f96514..9750600 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1888,10 +1888,10 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx 
*ctx, uint32_t domid, int *n
                                               &vtpm->backend_domid);
           if (rc) return NULL;
 
-          tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/uuid", be_path));
+          tmp = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/uuid", libxl_path));
           if(tmp) {
              if(libxl_uuid_from_string(&(vtpm->uuid), tmp)) {
-                LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a 
bug!!\n", be_path, tmp);
+                LOG(ERROR, "%s/uuid is a malformed uuid?? (%s) Probably a 
bug!!\n", libxl_path, tmp);
                 exit(1);
              }
           }
@@ -1947,7 +1947,7 @@ int libxl_device_vtpm_getinfo(libxl_ctx *ctx,
     vtpminfo->frontend_id = domid;
 
     val = libxl__xs_read(gc, XBT_NULL,
-          GCSPRINTF("%s/uuid", vtpminfo->backend));
+          GCSPRINTF("%s/uuid", libxl_path));
     if(val == NULL) {
        LOG(ERROR, "%s/uuid does not exist!\n", vtpminfo->backend);
        goto err;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.