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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED 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 4823EC43381 for ; Tue, 19 Mar 2019 16:37:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 196F720857 for ; Tue, 19 Mar 2019 16:37:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AwlVP6hK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 196F720857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=w8yUL4/IW4mZw1+gCF5mgsABzStSJ+N2u+CwIwtbUoA=; b=AwlVP6hKLyOUTu 7jb/fcT9ZpNa4s6+JWTvTgbNJuhayp9V1xBr8unuVwhkAs6IRj5CdsW4H9dskVSRLFs8TG0h2L2ob Q+QsrbKYFRbmsM5a7BdBQrUCmTgc0udqKea2HmtSiGTl4hJ29WnCcVgPaL2F8B6FKi6E9zp7Aorqo RCjVKdlXjvbisfQiupCwMRneeU7qXtUq6X1dEPKrOb+QcfS9YD5RPad4PgaTVXdsbJ9a7d10kkXur ywNPC/Ybg9fo9qkR3uIzVwk72J36E9WWB4z2WIEmmU/tLVCLSAEfm/pn1vtmxrtVQt/aMfP9unaci hJqBde4pXJnc37C/fOew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6HkH-0003SN-53; Tue, 19 Mar 2019 16:37:45 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6HkE-0003S2-CA for linux-arm-kernel@lists.infradead.org; Tue, 19 Mar 2019 16:37:43 +0000 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 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") X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190319_093742_423925_C0BD462D X-CRM114-Status: GOOD ( 14.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Grygorii Strashko , Yufen Wang , Arnd Bergmann , linux-kernel@vger.kernel.org, Russell King , Russell King , Dietmar Eggemann , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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.