ia64/xen-unstable

changeset 18814:bddd2d344c54

x86: secure ioapic_guest_write() against FREE_TO_ASSIGN irq values

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Nov 19 16:11:39 2008 +0000 (2008-11-19)
parents 4107618ee0d8
children 98d48f7680db
files xen/arch/x86/io_apic.c
line diff
     1.1 --- a/xen/arch/x86/io_apic.c	Wed Nov 19 16:10:39 2008 +0000
     1.2 +++ b/xen/arch/x86/io_apic.c	Wed Nov 19 16:11:39 2008 +0000
     1.3 @@ -2196,7 +2196,7 @@ int ioapic_guest_write(unsigned long phy
     1.4      if ( new_rte.vector >= FIRST_DYNAMIC_VECTOR )
     1.5          new_irq = vector_irq[new_rte.vector];
     1.6  
     1.7 -    if ( (old_irq != new_irq) && (old_irq != -1) && IO_APIC_IRQ(old_irq) )
     1.8 +    if ( (old_irq != new_irq) && (old_irq >= 0) && IO_APIC_IRQ(old_irq) )
     1.9      {
    1.10          if ( irq_desc[IO_APIC_VECTOR(old_irq)].action )
    1.11          {
    1.12 @@ -2208,7 +2208,7 @@ int ioapic_guest_write(unsigned long phy
    1.13          remove_pin_at_irq(old_irq, apic, pin);
    1.14      }
    1.15  
    1.16 -    if ( (new_irq != -1) && IO_APIC_IRQ(new_irq) )
    1.17 +    if ( (new_irq >= 0) && IO_APIC_IRQ(new_irq) )
    1.18      {
    1.19          if ( irq_desc[IO_APIC_VECTOR(new_irq)].action )
    1.20          {