From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14F4ACA9EC9 for ; Mon, 4 Nov 2019 22:22:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D3B89204EC for ; Mon, 4 Nov 2019 22:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572906148; bh=DuplhoRQredmAuojEW6TUPC1yPAM/K2dTnu2HW9tcM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0YNmTwEleutDMN86drCHAaxel57Lgol0S84BR5Pe+qkvNKbmsz3I4btchhodaJjW6 Y3qsd2Tw6tF3eoXxvV6ZCRnvVC7XmR0bbHOHzDyeQjZdklhkLPqTP7qOLxBF5FZfE/ /8L/qKOUL9npCPR4LiGzgD4YvWif5XLGtWmCMbEA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388374AbfKDV4a (ORCPT ); Mon, 4 Nov 2019 16:56:30 -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-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@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