|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v7 01/32] 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.
Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/common/compat/domain.c | 5 +++++
xen/common/domain.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 3ca4ef7..5dc7d94 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -23,6 +23,8 @@ CHECK_SIZE_(struct, vcpu_info);
CHECK_vcpu_register_vcpu_info;
#undef xen_vcpu_register_vcpu_info
+extern vcpu_info_t dummy_vcpu_info;
+
int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void)
arg)
{
struct domain *d = current->domain;
@@ -38,6 +40,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;
diff --git a/xen/common/domain.c b/xen/common/domain.c
index cda60a9..cec0dcf 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -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)
{
--
1.9.5 (Apple Git-50.3)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |