Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1535588img; Tue, 19 Mar 2019 09:40:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyz9WYeFopOTl4jq/fHDIGJFM1VcWcljD++wgme6oEDMDEYIjKs7u7Yp4iYgS7jXczG36GI X-Received: by 2002:a17:902:bd02:: with SMTP id p2mr26280319pls.260.1553013618527; Tue, 19 Mar 2019 09:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553013618; cv=none; d=google.com; s=arc-20160816; b=ezIXoYSctQvAcT+4nAOuIEsCcdpNsq/Pmjnhqo7O2yVNXhYoWTXYQX8f38/FOB3NmJ ZhY8ZPhmdsP7ilkJsL49TCbHZsYLYcT9U52K/47w35idk6k3sfsXJADqoQTRrQQgOzuR UUSgEseeXBkcC8iC6ML7UqqGRoFO9jBJjzi6su36lA9BH7bhhOmVCI5CXrEealGyQTvX 8lSPIQaCbKvtyG7Am8SxeQ45MYL4La53ysseEfSJS+wDEOsPD6DFgOiHdxB9a59wWyhS K8gAi/1CFD/SIRVsoxblGOyKTQ9hyIviTnUVp5kKWIAMK8nEdQFlMofOYXlHdBZBhtKO ciTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:user-agent :references:in-reply-to:subject:cc:to:from:message-id:date; bh=kZVw6ce1SuGZphKrbemXk/dgtk/pdChNP2td9fRsNc0=; b=nUcs6vUaG5XJOOsQnDq2jMRj0Xjd+UCR1gQOR7TunMQyRAxdMNKOfP4DISSWI5nf32 NIrLtR++OmTnTNj8WMG6ancNEjom+Z7Mqs5LEm2bWgoSraMpBNr0fQIJ0xVQ9/gtqHoh dnjBzXfRmaIw9b7zwZJlrVcCDLc+CQLAViTWj8S8xNZHYiiF9cBglMW1AaYMaOWq/vmh j1M7K3nYrEgnbHe1JfWvZZMl2fFpFTXMBwnp2sa/TxlFDpQs+o6DbtlWZoa848rJSpyq pRsEMZlMeaVNSe2ANBIOa34xC9/RaCRohfpEvKT5ufhfAQ60eLwzvmUHNmVqF5Ji/01y bbcg== ARC-Authentication-Results: i=1; mx.google.com; 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 o24si11611116pgh.114.2019.03.19.09.40.03; Tue, 19 Mar 2019 09:40:18 -0700 (PDT) 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; 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 S1727831AbfCSQhm (ORCPT + 99 others); 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.