From: "Jan Beulich" Subject: [PATCH] linux/x86: fix off-by-one error in the pirq range checks Date: Mon, 16 Feb 2009 16:47:46 +0000 Message-ID: <4999A6C2.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 --- 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) =20 BUG_ON(irq !=3D AUTO_ASSIGN && (unsigned)irq >=3D NR_IRQ_VECTORS); =20 - if (irq < PIRQ_BASE || irq - PIRQ_BASE > NR_PIRQS) + if (irq < PIRQ_BASE || irq - PIRQ_BASE >=3D NR_PIRQS) return -EINVAL; =20 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,=20 =20 BUG_ON(irq !=3D AUTO_ASSIGN && (unsigned)irq >=3D NR_IRQ_VECTORS); =20 - if (irq < PIRQ_BASE || irq - PIRQ_BASE > NR_PIRQS) + if (irq < PIRQ_BASE || irq - PIRQ_BASE >=3D NR_PIRQS) return -EINVAL; =20 spin_lock_irqsave(&vector_lock, flags);