aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-04-18 16:11:23 +0200
committerJan Beulich <jbeulich@suse.com>2013-04-18 16:11:23 +0200
commit545607eb3cfeb2abf5742d1bb869734f317fcfe5 (patch)
tree6039c103db155c2f36625ffd75d7262d5dfdc5c4 /xen/common
parentfdac9515607b757c044e7ef0d61b1453ef999b08 (diff)
downloadxen-545607eb3cfeb2abf5742d1bb869734f317fcfe5.tar.gz
xen-545607eb3cfeb2abf5742d1bb869734f317fcfe5.tar.bz2
xen-545607eb3cfeb2abf5742d1bb869734f317fcfe5.zip
x86: fix various issues with handling guest IRQs
- properly revoke IRQ access in map_domain_pirq() error path - don't permit replacing an in use IRQ - don't accept inputs in the GSI range for MAP_PIRQ_TYPE_MSI - track IRQ access permission in host IRQ terms, not guest IRQ ones (and with that, also disallow Dom0 access to IRQ0) This is CVE-2013-1919 / XSA-46. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'xen/common')
-rw-r--r--xen/common/domctl.c5
-rw-r--r--xen/common/event_channel.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6bd8efdf06..73b12c8a4d 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -25,6 +25,7 @@
#include <xen/paging.h>
#include <xen/hypercall.h>
#include <asm/current.h>
+#include <asm/irq.h>
#include <asm/page.h>
#include <public/domctl.h>
#include <xsm/xsm.h>
@@ -777,9 +778,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
else if ( xsm_irq_permission(XSM_HOOK, d, pirq, allow) )
ret = -EPERM;
else if ( allow )
- ret = irq_permit_access(d, pirq);
+ ret = pirq_permit_access(d, pirq);
else
- ret = irq_deny_access(d, pirq);
+ ret = pirq_deny_access(d, pirq);
}
break;
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0a6684c6d5..64c976b20a 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -369,7 +369,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
return -EINVAL;
- if ( !is_hvm_domain(d) && !irq_access_permitted(d, pirq) )
+ if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
return -EPERM;
spin_lock(&d->event_lock);