Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: fw: sni: Fix out of bounds init of o32 stack

Use ARRAY_SIZE to caluculate the top of the o32 stack.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

authored by

Thomas Bogendoerfer and committed by
Paul Burton
efcb5296 46f16195

+1 -1
+1 -1
arch/mips/fw/sni/sniprom.c
··· 43 43 44 44 /* O32 stack has to be 8-byte aligned. */ 45 45 static u64 o32_stk[4096]; 46 - #define O32_STK &o32_stk[sizeof(o32_stk)] 46 + #define O32_STK (&o32_stk[ARRAY_SIZE(o32_stk)]) 47 47 48 48 #define __PROM_O32(fun, arg) fun arg __asm__(#fun); \ 49 49 __asm__(#fun " = call_o32")