Skip to contentSkip to conversation

libxl: adjustment to initiate_domain_create

PATCH In review Wei Liu 3 participants 6 messages Nov 3, 2016 – Nov 4, 2016

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

cover libxl: adjustment to initiate_domain_create

Wei Liu (2):
libxl: set ret in the check for nestedhvm and altp2m
libxl: disallow enabling PoD and ALTP2M at the same time

 tools/libxl/libxl_create.c | 9 +++++++++
 1 file changed, 9 insertions(+)
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#1 lore raw

PATCH 1/2 libxl: set ret in the check for nestedhvm and altp2m

The error path expects ret to be set, otherwise an assertion is triggered.

---
Cc: Ian Jackson <[email protected]>

Please backport to 4.6 and 4.7.

---
 tools/libxl/libxl_create.c | 1 +
 1 file changed, 1 insertion(+)
tools/libxl/libxl_create.c +1 -0
index d986cd2..abd2272 100644
@@ -910,6 +910,7 @@ static void initiate_domain_create(libxl__egc *egc,
     if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM &&
         (libxl_defbool_val(d_config->b_info.u.hvm.nested_hvm) &&
          libxl_defbool_val(d_config->b_info.u.hvm.altp2m))) {
+        ret = ERROR_INVAL;
         LOG(ERROR, "nestedhvm and altp2mhvm cannot be used together");
         goto error_out;
     }
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#3 lore raw

PATCH 2/2 libxl: disallow enabling PoD and ALTP2M at the same time

In reply to Wei Liu

That combination would cause Xen to crash.

Note that although this is a security issue, is not XSA-worthy because ALTP2M is experimental.

---
Move the snippet to the correct location after altp2m is correctly initialised. Also correctly set ret before exiting.

Cc Ian Jackson <[email protected]>
Cc Jan Beulich <[email protected]>
Cc George Dunlap <[email protected]>,
Cc Andrew Cooper <[email protected]>
Cc Kevin Tian <[email protected]>
Cc Jun Nakajima <[email protected]>
---
 tools/libxl/libxl_create.c | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/libxl/libxl_create.c +8 -0
index abd2272..7c1695a 100644
@@ -915,6 +915,14 @@ static void initiate_domain_create(libxl__egc *egc,
         goto error_out;
     }
 
+    if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM &&
+        libxl_defbool_val(d_config->b_info.u.hvm.altp2m) &&
+        pod_enabled) {
+        ret = ERROR_INVAL;
+        LOG(ERROR, "Cannot enable PoD and ALTP2M at the same time");
+        goto error_out;
+    }
+
     ret = libxl__domain_make(gc, d_config, &domid, &state->config);
     if (ret) {
         LOG(ERROR, "cannot make domain: %d", ret);
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH for-4.8 2/2] libxl: disallow enabling PoD and ALTP2M at the same time

Quoted 43 lines

From: Wei Liu [mailto:[email protected]]
Sent: Friday, November 04, 2016 12:42 AM

That combination would cause Xen to crash.

Note that although this is a security issue, is not XSA-worthy because ALTP2M is experimental.

---
Move the snippet to the correct location after altp2m is correctly initialised. Also correctly set ret before exiting.

Cc Ian Jackson <[email protected]>
Cc Jan Beulich <[email protected]>
Cc George Dunlap <[email protected]>,
Cc Andrew Cooper <[email protected]>
Cc Kevin Tian <[email protected]>
Cc Jun Nakajima <[email protected]>
---
 tools/libxl/libxl_create.c | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/libxl/libxl_create.c +8 -1
index abd2272..7c1695a 100644
@@ -915,6 +915,14 @@ static void initiate_domain_create(libxl__egc *egc,
         goto error_out;
     }
 
+    if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM &&
+        libxl_defbool_val(d_config->b_info.u.hvm.altp2m) &&
+        pod_enabled) {
+        ret = ERROR_INVAL;
+        LOG(ERROR, "Cannot enable PoD and ALTP2M at the same time");
+        goto error_out;
+    }
+
     ret = libxl__domain_make(gc, d_config, &domid, &state->config);
     if (ret) {
         LOG(ERROR, "cannot make domain: %d", ret);
--
Quoted 1 line

2.1.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Acked-by on v1 2/2
#5 lore raw

Re: [PATCH for-4.8 2/2] libxl: disallow enabling PoD and ALTP2M at the same time

In reply to Wei Liu

Wei Liu writes ("[PATCH for-4.8 2/2] libxl: disallow enabling PoD and ALTP2M at the same time"):

Quoted 4 lines

That combination would cause Xen to crash.

Note that although this is a security issue, is not XSA-worthy because ALTP2M is experimental.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel