Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4488534ybx; Mon, 4 Nov 2019 14:15:43 -0800 (PST) X-Google-Smtp-Source: APXvYqwKRC+cDhwg49WvYRDohOgElKa1P5hy8t8Q7iGjF9E3NnvcbCt2gEuzughioVG/gH672MeB X-Received: by 2002:a17:906:3ca:: with SMTP id c10mr25964389eja.140.1572905742949; Mon, 04 Nov 2019 14:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572905742; cv=none; d=google.com; s=arc-20160816; b=pvE+c/L44kdUF2nN+iKTjU3fka8Dnv4B5d1bqhsUX00uMftNa7VVF++I/dOEdVyCKN h2ALRLwIPl9jnzmb/lZZqyXU35+0JNOFt6WoOFwEWog/Nfvkwk6lJqDH8n6hli0Dk6cS pUWI5u3+ixkixxigR47Ak7h+wKOH/du0z3PbpNXVJOD0+kcu6gZ3cXy3c58CGxtx3VQ5 CDayLU1J58luQ0jIKkkN9RKtOGMRfTzgaJjkwi0Iv+mirltmZahdAZE6Rpjez6l/vXiO 32QzBSZ3QSTxJIczbzOD52OCfCZVnmH+PSbpTi6IUtFOlLoHFaFqAeM+MLugLvnQwrbM mLWQ== 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=6jSWRBz/chBfKwrnXThTkJBqLpGmKpxbTfEXYlyZuvQ=; b=QGJuxhBirGi3PoD4tjshtn6IKmJ6YiX5gfL4gIomSlDqMRzcf4hRzctaSkVArIiA/G yYOvfG7owfyvshe5SrZcV2CloIKskwknUX844jdNxIPTUJLjZUgb3mVgcHy8E/KeaiNV 9lHwDh3D+WtzFzU5cyG5yuoL9wLF5ehnTjK6MZWM45e6EwJ6mWpDo+ex4/2JFmCeOWGJ Ph7jXqNXQQAS5B83d6iDDE+CQamNdMSKhC1eCEfLnzXflOOSj4wkqGcXC9oWv3ip7ZD/ 94vSWTYt+3V5fX31Y0KKr9LR1TV5E8QVCzeQ1rLbGkY3V0xEfFUsuoKehaR4mK26MG1B edNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yIlz1SOZ; 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 b30si8730250edc.320.2019.11.04.14.15.19; Mon, 04 Nov 2019 14:15:42 -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=yIlz1SOZ; 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 S2390346AbfKDWOo (ORCPT + 99 others); Mon, 4 Nov 2019 17:14:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:39644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389231AbfKDWHP (ORCPT ); Mon, 4 Nov 2019 17:07:15 -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 931D3214D8; Mon, 4 Nov 2019 22:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905235; bh=IEy/Uf64WWx5r28Ky/7zeFyYJNzL1e4yhFukKOfLYi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yIlz1SOZZCeKsCWwVoa3FZkE2UfLE7qFcrqGOJKxzbvFcO4zVyz4GYfTiYyRitWBH 0b57a1rGMw94QKl4bNk4w2O8gxOJiN7zQ5e1RtGtGeOCfAkzVLDD/LuZzUuAOIhVhe ANBm/OmYOJyTtkp/cTv2cRmIZrtPhiVu4yKkhPX0= 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 5.3 075/163] MIPS: fw: sni: Fix out of bounds init of o32 stack Date: Mon, 4 Nov 2019 22:44:25 +0100 Message-Id: <20191104212145.593127357@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212140.046021995@linuxfoundation.org> References: <20191104212140.046021995@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 8772617b64cef..80112f2298b68 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") -- 2.20.1