[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/ioapic: Avoid trying to access the -1th ioapic.


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Mon, 09 Sep 2013 12:43:13 -0700
  • Cc: Jan Beulich <JBeulich@xxxxxxxx>
  • Delivery-date: Mon, 09 Sep 2013 19:43:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac6tlNH7fpiPZ+pN60epdTXqUo9/pw==
  • Thread-topic: [PATCH] x86/ioapic: Avoid trying to access the -1th ioapic.

On 09/09/2013 12:36, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx> wrote:

> Discovered by Coverity, CID 1055743
> 
> Depending on the contents of the mp_irqs/mp_ioapics from the MP table,
> find_isa_irq_apic() might return -1, at which point calling
> ioapic_read_entry() with it is bad.
> 
> In addition to bailing if pin is -1, bail if apic is -1.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> CC: Keir Fraser <keir@xxxxxxx>
> CC: Jan Beulich <JBeulich@xxxxxxxx>

Acked-by: Keir Fraser <keir@xxxxxxx>

> ---
>  xen/arch/x86/io_apic.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
> index 048c61c..5512cd5 100644
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -1828,7 +1828,7 @@ static void __init unlock_ExtINT_logic(void)
>  
>      pin = find_isa_irq_pin(8, mp_INT);
>      apic = find_isa_irq_apic(8, mp_INT);
> -    if (pin == -1)
> +    if ( pin == -1 || apic == -1 )
>          return;
>  
>      entry0 = ioapic_read_entry(apic, pin, 0);



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.