Jan Beulich
2009-Feb-16 16:47 UTC
[Xen-devel] [PATCH] linux/x86: fix off-by-one error in the pirq range checks
As usual, written and tested on 2.6.27.x and made apply to the 2.6.18 tree without further testing. Signed-off-by: Jan Beulich <jbeulich@novell.com> --- sle11-2009-02-16.orig/arch/i386/kernel/io_apic-xen.c 2009-02-16 17:04:32.000000000 +0100 +++ sle11-2009-02-16/arch/i386/kernel/io_apic-xen.c 2009-02-16 17:05:52.000000000 +0100 @@ -1233,7 +1233,7 @@ static int __assign_irq_vector(int irq) BUG_ON(irq != AUTO_ASSIGN && (unsigned)irq >= NR_IRQ_VECTORS); - if (irq < PIRQ_BASE || irq - PIRQ_BASE > NR_PIRQS) + if (irq < PIRQ_BASE || irq - PIRQ_BASE >= NR_PIRQS) return -EINVAL; spin_lock_irqsave(&vector_lock, flags); --- sle11-2009-02-16.orig/arch/x86_64/kernel/io_apic-xen.c 2009-02-16 17:04:32.000000000 +0100 +++ sle11-2009-02-16/arch/x86_64/kernel/io_apic-xen.c 2009-02-16 17:05:52.000000000 +0100 @@ -858,7 +858,7 @@ static int __assign_irq_vector(int irq, BUG_ON(irq != AUTO_ASSIGN && (unsigned)irq >= NR_IRQ_VECTORS); - if (irq < PIRQ_BASE || irq - PIRQ_BASE > NR_PIRQS) + if (irq < PIRQ_BASE || irq - PIRQ_BASE >= NR_PIRQS) return -EINVAL; spin_lock_irqsave(&vector_lock, flags); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel