summaryrefslogtreecommitdiffstats
path: root/arch/mips/fw/sni
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-10-09 17:10:56 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-06 13:06:04 +0100
commit5865397db6c3a9eb5c790e5c01ace9b29f3955d1 (patch)
treebd26e48b5dc299226e4fca5ad7bb1a4af9a8a977 /arch/mips/fw/sni
parent317b6f68abb1f7cfe41b3419b13ad6f8a4cd8492 (diff)
downloadlinux-stable-5865397db6c3a9eb5c790e5c01ace9b29f3955d1.tar.gz
linux-stable-5865397db6c3a9eb5c790e5c01ace9b29f3955d1.tar.bz2
linux-stable-5865397db6c3a9eb5c790e5c01ace9b29f3955d1.zip
MIPS: fw: sni: Fix out of bounds init of o32 stack
[ Upstream commit efcb529694c3b707dc0471b312944337ba16e4dd ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/mips/fw/sni')
-rw-r--r--arch/mips/fw/sni/sniprom.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/fw/sni/sniprom.c b/arch/mips/fw/sni/sniprom.c
index 8772617b64ce..80112f2298b6 100644
--- a/arch/mips/fw/sni/sniprom.c
+++ b/arch/mips/fw/sni/sniprom.c
@@ -43,7 +43,7 @@
/* O32 stack has to be 8-byte aligned. */
static u64 o32_stk[4096];
-#define O32_STK &o32_stk[sizeof(o32_stk)]
+#define O32_STK (&o32_stk[ARRAY_SIZE(o32_stk)])
#define __PROM_O32(fun, arg) fun arg __asm__(#fun); \
__asm__(#fun " = call_o32")