]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
libxc: add missing xc_hypercall_bounce_pre calls
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Tue, 26 May 2015 18:13:29 +0000 (14:13 -0400)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 3 Jun 2015 10:12:01 +0000 (11:12 +0100)
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_flask.c

index bb117f7708def5afaa76db1be98c38091dc3f3ce..e24a2e7e02565fcd388407b7bdb6d36f115403a9 100644 (file)
@@ -191,6 +191,12 @@ int xc_flask_getbool_byname(xc_interface *xch, char *name, int *curr, int *pend)
     DECLARE_FLASK_OP;
     DECLARE_HYPERCALL_BOUNCE(name, strlen(name), XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
+    if ( xc_hypercall_bounce_pre(xch, name) )
+    {
+        PERROR("Could not bounce memory for flask op hypercall");
+        return -1;
+    }
+
     op.cmd = FLASK_GETBOOL;
     op.u.boolean.bool_id = -1;
     op.u.boolean.size = strlen(name);
@@ -217,6 +223,12 @@ int xc_flask_setbool(xc_interface *xch, char *name, int value, int commit)
     DECLARE_FLASK_OP;
     DECLARE_HYPERCALL_BOUNCE(name, strlen(name), XC_HYPERCALL_BUFFER_BOUNCE_IN);
 
+    if ( xc_hypercall_bounce_pre(xch, name) )
+    {
+        PERROR("Could not bounce memory for flask op hypercall");
+        return -1;
+    }
+
     op.cmd = FLASK_SETBOOL;
     op.u.boolean.bool_id = -1;
     op.u.boolean.new_value = value;