Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4470158ybx; Mon, 4 Nov 2019 13:58:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxcQ6ddashBNCslVBWSzABBKLc0Eu4vdkgZWpXNbU4EHIRcAXA5PKDOeNslpoEOnPCcBXMg X-Received: by 2002:a17:906:6094:: with SMTP id t20mr1149587ejj.316.1572904731743; Mon, 04 Nov 2019 13:58:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572904731; cv=none; d=google.com; s=arc-20160816; b=pvy/TwavvwKS+zLGfyR7OvZvScdDNe+pCi7jD+9ConrEa5aR9zpBCip+QqISQ06JsO M6ckXxM/JT8I4gK4m4O41Dy1bGc4OLOmaKrpKdjmY836r+/i+xClWDms9ErEBBqL0YOx 12r1Gif8VSXvXaoynWUHc/Lt1i1YFWDRpymZ+L4DZpg72mr6B6Bf9fdyoZhYWbNfjyIO V7AtJYiBIesBrmlOLuTPWW8ZiYnXrUTONaPt1owd6wftGaxlrvT6rGVRCxmNbaji3fFZ IvtJSFF6SCTJ0xHsPXUaMZfmFj3z178LY3D8ka8U2ikEsVjTJq0wqRTs+6jR+bqKOIT7 8Xrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mjNMFaYUDK3lQflGToujQSFBFRos3BcJOl0cLonr6ng=; b=R2EzzAALW12RfcV7VYRZ7uVgm6HyoSOCBuYZRTpN+AnTbxKbnZqJ8wKnUfn81pBzp7 gjblZxsvlhB51btGn5jt+P1pYD1a+YD1G3Z0O2wBk5996CsRCxbr/kjSCWMajc5FlICo X85uSmx7mj0yWvtXKON0oADotZCZ84t7auRu1cu3dBFUc/oNtehOPqQmBTySZUL5sLnn 90shjG9QPB+82wn9T64xk9jPrSVgLM0EShK7C/bBBlmnQtDPyU0KHOXSS/OAeF8Y8ds/ HddWyHzk5AcaSGiCitAV+caLq3t6RZqBsSrvYicNHmizoxAuKRf+ITPJ29E/WJHJ412w b5WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aZPb8jbg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si12526254ejg.44.2019.11.04.13.58.28; Mon, 04 Nov 2019 13:58:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aZPb8jbg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388387AbfKDV4b (ORCPT + 99 others); Mon, 4 Nov 2019 16:56:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:52056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388349AbfKDV43 (ORCPT ); Mon, 4 Nov 2019 16:56:29 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2756D217F5; Mon, 4 Nov 2019 21:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904587; bh=DuplhoRQredmAuojEW6TUPC1yPAM/K2dTnu2HW9tcM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aZPb8jbg3LnGNqP2Izv+2fUacZZO8ttLvlvzKk0w6lHpVcFB8it9oAcqK3O50JIQP yVxCSgtzRyTsh13foUKZ7D0AvdM4ZVHPVmgFnngS/EYbwVuJLR45XrOWOefVJUKOzN LDoYnxiD7t0QpLMxzd4hEV9lYcRkoTViG5f5ERXU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Bogendoerfer , Paul Burton , Ralf Baechle , James Hogan , linux-mips@vger.kernel.org, Sasha Levin Subject: [PATCH 4.14 52/95] MIPS: fw: sni: Fix out of bounds init of o32 stack Date: Mon, 4 Nov 2019 22:44:50 +0100 Message-Id: <20191104212104.572057858@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212038.056365853@linuxfoundation.org> References: <20191104212038.056365853@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Bogendoerfer [ Upstream commit efcb529694c3b707dc0471b312944337ba16e4dd ] Use ARRAY_SIZE to caluculate the top of the o32 stack. Signed-off-by: Thomas Bogendoerfer Signed-off-by: Paul Burton Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Sasha Levin --- arch/mips/fw/sni/sniprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/fw/sni/sniprom.c b/arch/mips/fw/sni/sniprom.c index 6aa264b9856ac..7c6151d412bd7 100644 --- a/arch/mips/fw/sni/sniprom.c +++ b/arch/mips/fw/sni/sniprom.c @@ -42,7 +42,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") -- 2.20.1