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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham 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 A13A3C43381 for ; Tue, 19 Mar 2019 16:37:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BF5420857 for ; Tue, 19 Mar 2019 16:37:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727976AbfCSQhm (ORCPT ); Tue, 19 Mar 2019 12:37:42 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:55090 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfCSQhl (ORCPT ); Tue, 19 Mar 2019 12:37:41 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7DEC51650; Tue, 19 Mar 2019 09:37:41 -0700 (PDT) Received: from big-swifty.misterjones.org (unknown [10.37.9.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 323F73F614; Tue, 19 Mar 2019 09:37:39 -0700 (PDT) Date: Tue, 19 Mar 2019 16:37:36 +0000 Message-ID: <86imwezupb.wl-marc.zyngier@arm.com> From: Marc Zyngier To: Masahiro Yamada Cc: linux-arm-kernel@lists.infradead.org, Russell King , Grygorii Strashko , linux-kernel@vger.kernel.org, Yufen Wang , Russell King , Dietmar Eggemann , Arnd Bergmann Subject: Re: [PATCH] ARM: fix out-of-bound access to ipi_types[] In-Reply-To: <1553010745-26585-1-git-send-email-yamada.masahiro@socionext.com> References: <1553010745-26585-1-git-send-email-yamada.masahiro@socionext.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: ARM Ltd MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Mar 2019 15:52:25 +0000, Masahiro Yamada wrote: > > Since commit e7273ff49acf ("ARM: 8488/1: Make IPI_CPU_BACKTRACE a > "non-secure" SGI"), IPI_CPU_BACKTRACE is assigned to SGI7. > > raise_nmi() passes IPI_CPU_BACKTRACE (=7) into smp_cross_call(), > but it is above the array bound of ipi_types[]. > > Increase NR_IPI, and add the entry to ipi_types[]. > > This fixes the following GCC warning: > > CC arch/arm/kernel/smp.o > arch/arm/kernel/smp.c: In function 'raise_nmi': > arch/arm/kernel/smp.c:522:2: warning: array subscript 7 is above array bounds of 'const char *[7]' [-Warray-bounds] > trace_ipi_raise_rcuidle(target, ipi_types[ipinr]); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Signed-off-by: Masahiro Yamada > --- +Arnd. A fix for this has been around since 2016: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-February/409393.html and reposted several times since. I don't know why it hasn't been picked up. M. -- Jazz is not dead, it just smell funny.