From: Aaro Koskinen Date: Fri, 1 Nov 2013 15:06:03 +0000 (+0200) Subject: MIPS: cavium-octeon: fix out-of-bounds array access X-Git-Tag: next-20140116~105^2^2~74 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6bd3aac16afc1dbeea7dad60fce27ddc8fe9c05c;p=karo-tx-linux.git MIPS: cavium-octeon: fix out-of-bounds array access When booting with in-kernel DTBs, the pruning code will enumerate interfaces 0-4. However, there is memory reserved only for 4 so some other data will get overwritten by cvmx_helper_interface_enumerate(). Signed-off-by: Aaro Koskinen Acked-by: David Daney Acked-by: John Crispin Patchwork: http://patchwork.linux-mips.org/patch/6102/ --- diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper.c b/arch/mips/cavium-octeon/executive/cvmx-helper.c index d63d20dfbfb0..0e4b34036815 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-helper.c +++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c @@ -67,7 +67,7 @@ void (*cvmx_override_pko_queue_priority) (int pko_port, void (*cvmx_override_ipd_port_setup) (int ipd_port); /* Port count per interface */ -static int interface_port_count[4] = { 0, 0, 0, 0 }; +static int interface_port_count[5]; /* Port last configured link info index by IPD/PKO port */ static cvmx_helper_link_info_t