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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CA5B6C433EF for ; Fri, 1 Apr 2022 10:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=97uQsfw/ubYZg3g5OyMwmPwHH8Fd3QAeVkhP5xQWWZo=; b=HITZ0WPLkHuo6g Pj9uZCPVRp3D+UpuJ1WhlhwvhMOwebyUSdNpDeXxEdCovB2PP9UUabebueLEdXaJSOvTumNz86YzO ldoJDCxbRI1+4C9ee9OCFxF0CccxQVC9YbXdJaTGe1Wu6G4GE8q7w7dkl5l0LX7Az6WiJAhT5e/7K tpXI1pKxyFYELlgTVdcMuEe626qOdsiqbSaH+Hgt/jXc5CNhaRb0pH8cF4RV4iozKunKyq0PYn4PY 3FTWgBL5WTG2KWpJXbZQnzVQkI76AQs9f6xC4twQZGT8iZWT29FIeqPayfct63COakvXOlYPF1X1K tTeVanBiuTYGbl3zX27w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1naEG5-0058Yl-FC; Fri, 01 Apr 2022 10:11:57 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1naEG2-0058XX-6n for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2022 10:11:55 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DFC4F12FC; Fri, 1 Apr 2022 03:11:51 -0700 (PDT) Received: from bogus (unknown [10.57.43.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 264DE3F66F; Fri, 1 Apr 2022 03:11:49 -0700 (PDT) Date: Fri, 1 Apr 2022 11:11:47 +0100 From: Sudeep Holla To: Liviu Dudau Cc: Kees Cook , Lorenzo Pieralisi , Russell King , Sudeep Holla , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] ARM: vexpress/spc: Avoid negative array index when !SMP Message-ID: <20220401101147.xtweqtftmtwa3txk@bogus> References: <20220331190443.851661-1-keescook@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220401_031154_326809_D8AA2618 X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 01, 2022 at 10:28:29AM +0100, Liviu Dudau wrote: > On Thu, Mar 31, 2022 at 12:04:43PM -0700, Kees Cook wrote: > > When building multi_v7_defconfig+CONFIG_SMP=n, -Warray-bounds exposes > > a couple negative array index accesses: > > > > arch/arm/mach-vexpress/spc.c: In function 've_spc_clk_init': > > arch/arm/mach-vexpress/spc.c:583:21: warning: array subscript -1 is below array bounds of 'bool[2]' {aka '_Bool[2]'} [-Warray-bounds] > > 583 | if (init_opp_table[cluster]) > > | ~~~~~~~~~~~~~~^~~~~~~~~ > > arch/arm/mach-vexpress/spc.c:556:7: note: while referencing 'init_opp_table' > > 556 | bool init_opp_table[MAX_CLUSTERS] = { false }; > > | ^~~~~~~~~~~~~~ > > arch/arm/mach-vexpress/spc.c:592:18: warning: array subscript -1 is below array bounds of 'bool[2]' {aka '_Bool[2]'} [-Warray-bounds] > > 592 | init_opp_table[cluster] = true; > > | ~~~~~~~~~~~~~~^~~~~~~~~ > > arch/arm/mach-vexpress/spc.c:556:7: note: while referencing 'init_opp_table' > > 556 | bool init_opp_table[MAX_CLUSTERS] = { false }; > > | ^~~~~~~~~~~~~~ > > > > Skip this logic when built !SMP. > > > > Cc: Liviu Dudau > > Cc: Sudeep Holla > > Cc: Lorenzo Pieralisi > > Cc: Russell King > > Cc: linux-arm-kernel@lists.infradead.org > > Signed-off-by: Kees Cook > > Acked-by: Liviu Dudau > > Sudeep, can you please take this through your tree for sending it to arm-soc? > Sure, I will do that as soon as -rc1 is out. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel