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

[Xen-devel] [RFC PATCH V5 15/15] evtchn: only allow 3-level event channel on Dom0



Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/common/event_channel.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0f9e8e4..f48c3a2 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1118,7 +1118,10 @@ long do_event_channel_op(int cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case EVTCHNOP_query_extended_abis: {
         struct evtchn_query_extended_abis query;
+        struct domain *d = current->domain;
         query.abis = extended_event_channel;
+        if ( d->domain_id != 0 )
+            query.abis &= ~EVTCHN_EXTENDED_L3;
         rc = 0;
         if ( __copy_to_guest(arg, &query, 1) )
             rc = -EFAULT;
@@ -1127,6 +1130,9 @@ long do_event_channel_op(int cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
 
     case EVTCHNOP_register_3level: {
         struct evtchn_register_3level reg;
+        struct domain *d = current->domain;
+        if ( d->domain_id != 0 )
+            return -EPERM;
         if ( copy_from_guest(&reg, arg, 1) != 0 )
             return -EFAULT;
         rc = evtchn_register_3level(&reg);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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