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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E639C433F5 for ; Thu, 7 Apr 2022 10:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239437AbiDGKRI (ORCPT ); Thu, 7 Apr 2022 06:17:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbiDGKRE (ORCPT ); Thu, 7 Apr 2022 06:17:04 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B8BE4403D5; Thu, 7 Apr 2022 03:15:04 -0700 (PDT) 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 274A623A; Thu, 7 Apr 2022 03:15:04 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0248A3F5A1; Thu, 7 Apr 2022 03:15:02 -0700 (PDT) From: Sudeep Holla To: Liviu Dudau , Kees Cook Cc: Sudeep Holla , Lorenzo Pieralisi , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] ARM: vexpress/spc: Avoid negative array index when !SMP Date: Thu, 7 Apr 2022 11:14:52 +0100 Message-Id: <164932629049.1424947.13640596774017926989.b4-ty@arm.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220331190443.851661-1-keescook@chromium.org> References: <20220331190443.851661-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 31 Mar 2022 12:04:43 -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 }; > | ^~~~~~~~~~~~~~ > > [...] Applied to sudeep.holla/linux (fixes/vexpress), thanks! [1/1] ARM: vexpress/spc: Avoid negative array index when !SMP https://git.kernel.org/sudeep.holla/c/b3f1dd52c9 -- Regards, Sudeep 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 4E1C4C433EF for ; Thu, 7 Apr 2022 10:16:15 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j7X3tFZDc3pdYdBtYeUXprzShGHgs2wJP3INOrnMMvw=; b=3BuvCF8NXW0r9D IyB/G6oi9yh1lsupxiFF7BiPGQq/+cuX1sCsgKbmyuRXaXKdmNQxtIY7oL/PBx/ebsaXMUpnkbFvT l9bnuncqX6dYwAY/6kduInFps8gv4uj5Eo+3Nqe/cATUDyHwXk/fPpxTiGpsb3X+i+iUeNN2Y7QMM 70wqlqQQ4uKxKfhrtDqyWcpjcNp50jFR3pM05jKg1vDRZv5XMeMcu3OlHcAyoWqGU5iks869l33jV IMTBGtZ8M9lo1oi4vi/5vRB4d8Bgj8Z0n5VIskdgG/K87+MfQRllPLCZcTgPTlRbLYRaOI1zJmBGV 479J123vFMtzEDTDZ6Hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncPAU-00BA1n-Vh; Thu, 07 Apr 2022 10:15:11 +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 1ncPAR-00BA0i-AZ for linux-arm-kernel@lists.infradead.org; Thu, 07 Apr 2022 10:15:08 +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 274A623A; Thu, 7 Apr 2022 03:15:04 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0248A3F5A1; Thu, 7 Apr 2022 03:15:02 -0700 (PDT) From: Sudeep Holla To: Liviu Dudau , Kees Cook Cc: Sudeep Holla , Lorenzo Pieralisi , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] ARM: vexpress/spc: Avoid negative array index when !SMP Date: Thu, 7 Apr 2022 11:14:52 +0100 Message-Id: <164932629049.1424947.13640596774017926989.b4-ty@arm.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220331190443.851661-1-keescook@chromium.org> References: <20220331190443.851661-1-keescook@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220407_031507_451193_3BD8934E X-CRM114-Status: UNSURE ( 6.32 ) X-CRM114-Notice: Please train this message. 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 Thu, 31 Mar 2022 12:04:43 -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 }; > | ^~~~~~~~~~~~~~ > > [...] Applied to sudeep.holla/linux (fixes/vexpress), thanks! [1/1] ARM: vexpress/spc: Avoid negative array index when !SMP https://git.kernel.org/sudeep.holla/c/b3f1dd52c9 -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel