octeon: backport a few upstream fixes
[openwrt.git] / target / linux / octeon / patches-3.10 / 0008-MIPS-cavium-octeon-fix-out-of-bounds-array-access.patch
1 From 8b75e77048a378339ada86eff548a5b253212859 Mon Sep 17 00:00:00 2001
2 From: Aaro Koskinen <aaro.koskinen@nsn.com>
3 Date: Fri, 1 Nov 2013 17:06:03 +0200
4 Subject: [PATCH] MIPS: cavium-octeon: fix out-of-bounds array access
5
6 When booting with in-kernel DTBs, the pruning code will enumerate
7 interfaces 0-4. However, there is memory reserved only for 4 so some
8 other data will get overwritten by cvmx_helper_interface_enumerate().
9
10 Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
11 Acked-by: David Daney <david.daney@cavium.com>
12 Signed-off-by: John Crispin <blogic@openwrt.org>
13 Patchwork: http://patchwork.linux-mips.org/patch/6102/
14 ---
15  arch/mips/cavium-octeon/executive/cvmx-helper.c | 2 +-
16  1 file changed, 1 insertion(+), 1 deletion(-)
17
18 --- a/arch/mips/cavium-octeon/executive/cvmx-helper.c
19 +++ b/arch/mips/cavium-octeon/executive/cvmx-helper.c
20 @@ -67,7 +67,7 @@ void (*cvmx_override_pko_queue_priority)
21  void (*cvmx_override_ipd_port_setup) (int ipd_port);
22  
23  /* Port count per interface */
24 -static int interface_port_count[4] = { 0, 0, 0, 0 };
25 +static int interface_port_count[5];
26  
27  /* Port last configured link info index by IPD/PKO port */
28  static cvmx_helper_link_info_t