Skip to contentSkip to conversation

xen/vcpu: add missing dummy_vcpu_info to compat VCPUOP_initialise

PATCH New Roger Pau Monne 1 participant 1 message Oct 5, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xen/vcpu: add missing dummy_vcpu_info to compat VCPUOP_initialise

This check is missing from the compat version when compared to the non-compat version.

Cc Ian Campbell <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Tim Deegan <[email protected]>
Cc Andrew Cooper <[email protected]>

---
Changes since v1:
- Moved the declaration of dummy_vcpu_info to the header where vcpu_info_t is defined.

---
 xen/common/compat/domain.c | 3 +++
 xen/common/domain.c        | 2 +-
 xen/include/xen/shared.h   | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)
xen/common/compat/domain.c +3 -0
index 3ca4ef7..157570a 100644
@@ -38,6 +38,9 @@ int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) ar
     {
         struct compat_vcpu_guest_context *cmp_ctxt;
 
+        if ( v->vcpu_info == &dummy_vcpu_info )
+            return -EINVAL;
+
         if ( (cmp_ctxt = xmalloc(struct compat_vcpu_guest_context)) == NULL )
         {
             rc = -ENOMEM;
xen/common/domain.c +1 -1
index cda60a9..cec0dcf 100644
@@ -70,7 +70,7 @@ integer_param("hardware_dom", hardware_domid);
 
 struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
 
-static vcpu_info_t dummy_vcpu_info;
+vcpu_info_t dummy_vcpu_info;
 
 static void __domain_finalise_shutdown(struct domain *d)
 {
xen/include/xen/shared.h +2 -0
index 3f5b283..a411a8a 100644
@@ -41,6 +41,8 @@ typedef struct vcpu_info vcpu_info_t;
 
 #endif
 
+extern vcpu_info_t dummy_vcpu_info;
+
 #define shared_info(d, field)      __shared_info(d, (d)->shared_info, field)
 #define vcpu_info(v, field)        __vcpu_info(v, (v)->vcpu_info, field)
 
Signature · 7 lines
1.9.5 (Apple Git-50.3)


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