Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2950072rwo; Mon, 24 Jul 2023 04:08:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlEE6qrV5kHA8vIEX6tFv2PIEYfxkg1q4FYh63oanGjUsglMmtNCqYCzqPQAqE7LoGJjUynu X-Received: by 2002:a17:906:5350:b0:989:450:e56a with SMTP id j16-20020a170906535000b009890450e56amr9338156ejo.76.1690196933065; Mon, 24 Jul 2023 04:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690196933; cv=none; d=google.com; s=arc-20160816; b=rlZ20y3RoO1+Gm42OLfQgevOoHmlETb/JCrZr7vvUmtT3T4/hnVttRxe0BR89nDmPi SnmwJm1BYqFG4DjRjjGQRkkMzBYbT1VpuYkequQv6DIX1lzP0AmcmZKFzoBUtqNeY4P8 q+0+NCEX8OjWRdNN7deNXfRG5pKYHoJfzADHW7ZLkDjn0JoHM1JxGnQuNWmnhc7zHdJ2 OT8AGH6SQRSaKwFwTCrl4ZiTFJQMQkofcDHAOUUQqvJCVFv7glRA9N3ShY3BSvnn63Pc 4CGB+/eYKK8Z4EOl3XThyzf7Ea4COAbMFQhFe1IAa+QjM4BcJ3cUcIqJ1JE4unMtQLaf BncQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :message-id:subject:references:in-reply-to:cc:to:from:dkim-signature; bh=wmh/FrqSQOz70AHd4M71/ezoDBNSK6UKv94Q16QTADk=; fh=bfkwHIEFlr0NGzKkzi5JUZq1Xf3/Z8TH9e/vAO0AzoU=; b=gUf/PIgBLMMtycxA2P/4GjPYj/mbamv2PCC8nzJvDCMNtTCIw2ZsludbrO5NjQzzX2 MMJSrnS3CYLa7PXTHmkd1vShdfhxjvblNeJnTzjBmhJSdcJAGnI5UDtL/shivYiOQ3tu ih7MttuMjGnYXhgmHniZzvygO4+VpDPweQo2okrMTN0oNHfrrMjaziifq/jGAzAJLSKB 09HHTO/00IQZN9ACNKwvXTcuwY1ZBIVUExZIPA0AGHfdxy2HUCadQeS8iCX60d2FHzIU njraK/3Lcb8hWLqQuJ9kcxhjMsV4rqdfqkuoMXzuYGiX8mbUCA8V0+fMeiF29hy+6lxt m13g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tz+jsQpG; 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 j23-20020a170906095700b00993690d17a2si6458501ejd.5.2023.07.24.04.08.28; Mon, 24 Jul 2023 04:08:53 -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=Tz+jsQpG; 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 S233200AbjGXK4q (ORCPT + 99 others); Mon, 24 Jul 2023 06:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233226AbjGXK4k (ORCPT ); Mon, 24 Jul 2023 06:56:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4951DE49; Mon, 24 Jul 2023 03:56:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C3A866108E; Mon, 24 Jul 2023 10:56:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0DAEC433C7; Mon, 24 Jul 2023 10:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690196184; bh=Sq8Naj+SLCMOVbiFEc9mTSfYNfyJrtjHPO/jeFnc4H0=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=Tz+jsQpGP76OVVI/kBOsqmsVFQtqcnY7O+vQHC9NGAIXzV+BaiaDFAIYzI2BE06Up C4fnVV+JLd7a7jpBRmZYjJbm+RokcausZDGHsIM5JjRPWC4bB4oXSwkDGkp7eqaIFM u0FNUAg+XhjRtxmWOyL9GpLq7A4Advx/HnvrQHH+JJz+V6bpQzn8tMHIdyz7DmJ9k8 MsFFWDQxgp9CnwFMRK4JoFmvaHaHsFfewr/hwF2ySNy6AyLFkIkILok6D4bJCMxzL+ InVYotTrsaK2tg4AeXJmFE+iuNt1oD+OUz+GUX1Z2QH3F0tOy7wYUIoxRnCA9ffVT6 R/l9btkG05pBg== From: Vinod Koul To: Kishon Vijay Abraham I , Sergio Paracuellos , Heiko Stuebner , Rob Herring , Marc Kleine-Budde , David Yang , Shawn Guo , Pengcheng Li , Jiancheng Xue , linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Harshit Mogalapalli Cc: dan.carpenter@linaro.org, christophe.jaillet@wanadoo.fr, julia.lawall@inria.fr, kernel-janitors@vger.kernel.org, error27@gmail.com In-Reply-To: <20230721090558.3588613-1-harshit.m.mogalapalli@oracle.com> References: <20230721090558.3588613-1-harshit.m.mogalapalli@oracle.com> Subject: Re: [PATCH] phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() Message-Id: <169019617956.466731.9761851242432174423.b4-ty@kernel.org> Date: Mon, 24 Jul 2023 16:26:19 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 On Fri, 21 Jul 2023 02:05:55 -0700, Harshit Mogalapalli wrote: > The size of array 'priv->ports[]' is INNO_PHY_PORT_NUM. > > In the for loop, 'i' is used as the index for array 'priv->ports[]' > with a check (i > INNO_PHY_PORT_NUM) which indicates that > INNO_PHY_PORT_NUM is allowed value for 'i' in the same loop. > > This > comparison needs to be changed to >=, otherwise it potentially leads > to an out of bounds write on the next iteration through the loop > > [...] Applied, thanks! [1/1] phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() commit: 13c088cf3657d70893d75cf116be937f1509cc0f Best regards, -- ~Vinod