MIPS: GIC: Prevent array overrun
authorJeffrey Deans <jeffrey.deans@imgtec.com>
Thu, 17 Jul 2014 08:20:56 +0000 (09:20 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Sep 2014 16:19:14 +0000 (09:19 -0700)
commitfbd087f41f3a9ab0f63bb5d1df96a50a0715edc6
treea73e8ee8338ae9444202bddcdb8f477e37013a8f
parent6c4e8e0a0108f8cc9095a4e23df75b1873f59c31
MIPS: GIC: Prevent array overrun

commit ffc8415afab20bd97754efae6aad1f67b531132b upstream.

A GIC interrupt which is declared as having a GIC_MAP_TO_NMI_MSK
mapping causes the cpu parameter to gic_setup_intr() to be increased
to 32, causing memory corruption when pcpu_masks[] is written to again
later in the function.

Signed-off-by: Jeffrey Deans <jeffrey.deans@imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7375/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/kernel/irq-gic.c