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>
This commit is contained in:
Jan Beulich committed 2013-04-18 16:11:23 +02:00
1 parent fdac951560
commit 545607eb3c
9 files changed
+93 -30

No files matched your search

+6 -6
View File
@@ -73,6 +73,12 @@ class IRQController(DevController):
pirq = get_param('irq')
rc = xc.physdev_map_pirq(domid = self.getDomid(),
index = pirq,
pirq = pirq)
if rc < 0:
raise VmError('irq: Failed to map irq %x' % (pirq))
rc = xc.domain_irq_permission(domid = self.getDomid(),
pirq = pirq,
allow_access = True)
@@ -81,12 +87,6 @@ class IRQController(DevController):
#todo non-fatal
raise VmError(
'irq: Failed to configure irq: %d' % (pirq))
rc = xc.physdev_map_pirq(domid = self.getDomid(),
index = pirq,
pirq = pirq)
if rc < 0:
raise VmError(
'irq: Failed to map irq %x' % (pirq))
back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
return (self.allocateDeviceID(), back, {})
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.