Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp4092549rwa; Tue, 23 Aug 2022 16:15:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ZMhBKsHzgS9DAjbSoRjVbSwaLhkYm2hh+Py2rLPsw/Ak/3DvQexqnxg1nRW9dFwH9pah1 X-Received: by 2002:aa7:cc97:0:b0:445:afab:2634 with SMTP id p23-20020aa7cc97000000b00445afab2634mr5444050edt.54.1661296506204; Tue, 23 Aug 2022 16:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661296506; cv=none; d=google.com; s=arc-20160816; b=dxtXOubVc4EEw1S5hxwhfJ3TwCjAmMBvRHu3JilLDswvNZG1JKJAS/6GR66wQskRj2 YlcvJO3AwSVShoDmSmOdy+Kb6lUo8mlswwhe8eLAhlbWQdx56Sky6DxQ5l2klEqnMQsK WQBVy9M9Gt72Vv23eAo0YOQuUT6bkkwJ4Y6BVmx9jAVy6T8WnpyYpN3f0xQWrK7I5Plk JeD/7OUq8/OFHngXdhTAOJJobGiLb77JLHKOd0xLscOK9ecMSR3I/56kb0WmxnACSTct L2HV9dPo5CJTCvfgBBzLhCy4dZJ13goL4KuuwySVNCCXSymYYECe/ZE7pQQ4wsRg8FaP xA1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=ypcp98VMiz7kBu3cGUG6LeZApIJKQVW/y2vnoL910eE=; b=InFvY7Q/hke42CLQhoJlBvcKEjY0ZfFcg826VeYi3x1EN/KczbB+qsgySDXEiECLJa YopRzL91mE8lGrYj/QycQyCJjinnqKGgBmoEsw+ojQ27fAqngc5UUr/O8CyT7HIhSuV0 sfc9TrobknAj14wrEQ3EPdNDGpzslRgAW94P4K58siLMrLCciIV5fLENh0VRGc6t28ED BdrxxRPkAoYstfHDsP+KTRYK4OtWdjN3BXZMoc8DNGYKAbrak2s6sLGramKwxymcl75b pK9R/jJxphnPf9XDxK1iCsUKiVU6QY7sRoABiDQdZLmb78s4tVVBqr0Wt/y50NCxZWNA wA0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DZr0NmbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a170906794f00b0072fc714c92fsi47228ejo.902.2022.08.23.16.14.40; Tue, 23 Aug 2022 16:15:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DZr0NmbK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232007AbiHWWwP (ORCPT + 99 others); Tue, 23 Aug 2022 18:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231348AbiHWWwI (ORCPT ); Tue, 23 Aug 2022 18:52:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEF178C457; Tue, 23 Aug 2022 15:52:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EC798B821EA; Tue, 23 Aug 2022 22:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92B6DC433D6; Tue, 23 Aug 2022 22:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661295123; bh=ypcp98VMiz7kBu3cGUG6LeZApIJKQVW/y2vnoL910eE=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=DZr0NmbKznJeIxoMhkhF17OzDK9v7sRfbGjSpGHBhpuFXyaHu8pNRwi/f4WhYs1gu fekrHQ9D3yzuX7WWC9la2iCPghUT/3qpBnlV2W+ecrQekSCy1AuZS+x0Q9ITg7vxwq kqDbik3OjleTwSvxURbUmFKUVr9Qlj3oR+nuq1v0HACDIpkYN1ZVMQP1vxVdvfFL28 daUG1+gDBGClvtNGSaBHq3pBpfmKnHGbiEb1tWlquRDv1zfMlpceI2OWt+kdXL2L+8 QmiOq4fP2jZetKEMikK6z3hOqwNJhTGV8qPoOaI2pC/d5yPnDvrHSX7VAXOb2o/Xyg ULw0dMO4rLqNw== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220713154953.3336-2-stefan.wahren@i2se.com> References: <20220713154953.3336-1-stefan.wahren@i2se.com> <20220713154953.3336-2-stefan.wahren@i2se.com> Subject: Re: [PATCH 1/3] clk: bcm: rpi: Prevent out-of-bounds access From: Stephen Boyd Cc: bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wahren , Phil Elwell To: Florian Fainelli , Michael Turquette , Stefan Wahren Date: Tue, 23 Aug 2022 15:52:01 -0700 User-Agent: alot/0.10 Message-Id: <20220823225203.92B6DC433D6@smtp.kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Stefan Wahren (2022-07-13 08:49:51) > The while loop in raspberrypi_discover_clocks() relies on the assumption > that the id of the last clock element is zero. Because this data comes > from the Videocore firmware and it doesn't guarantuee such a behavior > this could lead to out-of-bounds access. So fix this by providing > a sentinel element. >=20 > Fixes: 93d2725affd6 ("clk: bcm: rpi: Discover the firmware clocks") > Link: https://github.com/raspberrypi/firmware/issues/1688 > Suggested-by: Phil Elwell > Signed-off-by: Stefan Wahren > --- Applied to clk-fixes