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 AEE2FC43334 for ; Wed, 13 Jul 2022 16:26:36 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JHuENQiGtElsa3d+uPAEqovJQYvfhdpTYCzGvyipapA=; b=X0KwSVmDzJ6Q7I L9DvBVGkVCnkWdP6k1hASV/QfMJZe7eW18hz3zc0GoUyeZpE3vXaf1i5armmjSF5xbdYW1lnbl5Bk sEq1NMOFvFQuRRpR+DQbFn7YzMKQ3GRewwebs1nugq6J/yqtIlAHjvzvkWP4pj0it559U4dDzI9Uc bUCnxSdwtGv/yR5KOIj4e8xNXE4hD2m0ixorBS7ergkoD60PLlVJEWOWJGPNt9WPB7FQHeMRSQXhB fBEFgaMxT57pWzeUhY2LKFaOyKNLnWu3QwAQC8j4QpsVZC49rG/HUXwLffqojjdBM/GcyQCB/ya1W ncoFuxkxx3hT3kJARWPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBfBC-005cL9-HA; Wed, 13 Jul 2022 16:25:38 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBfB9-005cJL-Uj for linux-arm-kernel@lists.infradead.org; Wed, 13 Jul 2022 16:25:37 +0000 Received: by mail-pj1-x102e.google.com with SMTP id q5-20020a17090a304500b001efcc885cc4so4442242pjl.4 for ; Wed, 13 Jul 2022 09:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=NJbO4Rf7TW4PsWVYRG0jsf+QfXdUdOnvfPpzJkjdl10=; b=K8CFPKXrzo/+w4DR3qbs+AiJ2G6A4nqZ+W4+EHcQsmTCrdVX0IOiIU/XHhgP1MEeoA zlCphALP5QjYKNpWvxH0XoPDDCqEpDMuII/dpHBo6sUOc4KdlmAPZNHDnsIBMDMU17xk mb94nVNeBorOUKnatbyq9HGsDF3Tkl2rJ9EYLM9M/X7k23Q+FypiNb9mSFv+9u2fcBsg eS5JatyHkL9Yrrxq18JfoSRZ+ZOCNB+Kzl395OLZ+tPTmBkYywt1qSEFcV7N5O6n1I59 omX+FsBqhSPRvkjCsAuN/+79Xlq8OuT4BIvV975qQ4z+174YbAtMo6Z2G8q8qJ+IQEUB bkNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=NJbO4Rf7TW4PsWVYRG0jsf+QfXdUdOnvfPpzJkjdl10=; b=ck1AWAisC2Ghhg8q3Bf1h9nLRlyd/gYrni7fdRJ/o2wmYhCkuZsSWgBrODOIdzdg4g 2CoVN+zDlloUOzYXDV6VaFByj88GdIeNOrh35LhHFldjGHehEGtU/jcdtf93+2ea+gg8 VY0S1YKsp1VhQhnfdo3P1JemKngZaS7M0JZOMP0v9vWwBAnr6pGhJDZnzvv9jUYf/N7R mzqxLaPrku161nC/gHkoURatKRlcuOQF4QjOmgAKskvHYXjfh67/dZ8LMLKvLb9wzEtt q4iw+W6COlHfCZf6IaWiQWTZ7+4U46uFjXyp2glisDTeTfP+f7DHnbclLH1zVPK33adz GkxA== X-Gm-Message-State: AJIora813qSHHT9tcYbghvgztQI3SUjcB9i6c6v9ijqmoNip4KlVqsHJ TH8+hnwRaA2RwEHugUJcJDo= X-Google-Smtp-Source: AGRyM1t5Ax5K3CFQ3IF1WTrSs4a59LOEuvGzfrnm9dnPEmKoOGt7ak6BqP/SE9amKPrt/ZHvrLpXew== X-Received: by 2002:a17:90a:eb09:b0:1ef:7df7:cdf7 with SMTP id j9-20020a17090aeb0900b001ef7df7cdf7mr4640215pjz.185.1657729535064; Wed, 13 Jul 2022 09:25:35 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id u5-20020a63d345000000b0041245ccb6b1sm8100098pgi.62.2022.07.13.09.25.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jul 2022 09:25:34 -0700 (PDT) Message-ID: <8dbb8841-6592-98c0-1da2-0673a28cb149@gmail.com> Date: Wed, 13 Jul 2022 09:25:31 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 1/3] clk: bcm: rpi: Prevent out-of-bounds access Content-Language: en-US To: Stefan Wahren , Florian Fainelli , Michael Turquette , 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, Phil Elwell References: <20220713154953.3336-1-stefan.wahren@i2se.com> <20220713154953.3336-2-stefan.wahren@i2se.com> From: Florian Fainelli In-Reply-To: <20220713154953.3336-2-stefan.wahren@i2se.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220713_092536_022229_D6563AB1 X-CRM114-Status: GOOD ( 11.57 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/13/22 08:49, Stefan Wahren wrote: > 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. > > 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 Acked-by: Florian Fainelli -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel