From: "Jan Beulich" Subject: Re: [PATCH] x86: fix an off-by-one pirq range check Date: Thu, 01 Jul 2010 08:27:23 +0100 Message-ID: <4C2C5F7B0200007800008FE9@vpn.id2.novell.com> References: <4C2B02460200007800008B83@vpn.id2.novell.com> <20100630161641.GE5100@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20100630161641.GE5100@phenom.dumpdata.com> 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: Konrad Rzeszutek Wilk Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 30.06.10 at 18:16, Konrad Rzeszutek Wilk = wrote: > On Wed, Jun 30, 2010 at 07:37:26AM +0100, Jan Beulich wrote: >> Signed-off-by: Jan Beulich >=20 > Won't that make PV guest with only one IRQ passed through unable to ACK = it? > (and if the IRQ is not shared that is). Why would you think so? In such a case, nr_pirqs would be 1, and the only permitted pirq would be 0. All other places do the range checks correctly, just this one would let through an out of bounds number. Jan > This code does get executed when the PHYSDEVOP_eoi hypercall is made I > believe. >>=20 >> --- 2010-06-15.orig/xen/arch/x86/irq.c 2010-06-15 13:23:00.0000000= 00 +0200 >> +++ 2010-06-15/xen/arch/x86/irq.c 2010-06-29 10:15:13.000000000 = +0200 >> @@ -1027,7 +1027,7 @@ static void __pirq_guest_eoi(struct doma >> =20 >> int pirq_guest_eoi(struct domain *d, int irq) >> { >> - if ( (irq < 0) || (irq > d->nr_pirqs) ) >> + if ( (irq < 0) || (irq >=3D d->nr_pirqs) ) >> return -EINVAL; >> =20 >> __pirq_guest_eoi(d, irq); >>=20 >>=20 >>=20 >>=20 >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com=20 >> http://lists.xensource.com/xen-devel=20