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 70489C624A4 for ; Thu, 3 Sep 2026 03:43:45 +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:References:In-Reply-To:From: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=TICKghSeVIZd1oo9dcRTjNZVLc1/v4tzoLcqd2+Obe8=; b=UGYu2Q9p/PUTJ2 RMrcVYdXcD3ij8mbzc/X65jU/7lVnFWtxOucPID2/8ZMIfAtlsU1LNph3rGA5u+JHJfg4sMsXzTgg QvgA9WnFb9I5jyw+2R4ZOHR/qMAKTszkEmf2CuIrgKhwgz7v96TwNoPZnqnQbs2dPypZxCDg0BfDq diqdcKsBLmSKkG3nC0qygF/kbUc5N3jGgWqPW3C7XrhGQUqhZd0nEAm1M1e8Rria8NMDx7tu6cojR NqiXqa5f4hvtZlIfc7fZwAE/UqmKOID5fB2lhb1Sp5OTNVOWs0VxaPQOBDEbJgwzJZLGufTe1mRqZ 3w7nJgjPOROj0xqsV57g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1yMa-0000000GI6a-3hgD; Thu, 03 Sep 2026 03:43:44 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1yMT-0000000GI53-2kDa for linux-phy@lists.infradead.org; Thu, 03 Sep 2026 03:43:44 +0000 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20260903034328epoutp025028a3156eb38e51fd45d7ed5ad1d087~RsrLtMR3Q1957719577epoutp02b for ; Thu, 3 Sep 2026 03:43:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20260903034328epoutp025028a3156eb38e51fd45d7ed5ad1d087~RsrLtMR3Q1957719577epoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1788407008; bh=hxQCmTNMct1DRhOL2zkVSmPzrkHNVIa3V+xEsZNmDLo=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=X55mDB+o3vq/x9sQQI0kgJmccvhvqmrDBVLetGnJ5rysGFps+x9Z5pg7e7DEXHRPL 2/0SyS3NM44wZzXZXqvahQaKVflAHUL/zLeWNphMMxl2hTsWm6SPg144C/7xDZOZAj sP9cSdln4Wrv0RDmhF5uwlfamEGNLhGR+3orqEH0= Received: from epsnrtp04.localdomain (unknown [182.195.42.156]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPS id 20260903034328epcas5p2d368d9a3526cfa324b3ace3ce9cf3757~RsrLRYlZE1311513115epcas5p2y; Thu, 3 Sep 2026 03:43:28 +0000 (GMT) Received: from epcas5p3.samsung.com (unknown [182.195.38.90]) by epsnrtp04.localdomain (Postfix) with ESMTP id 4hb56R0c1hz6B9m5; Thu, 3 Sep 2026 03:43:27 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20260903034326epcas5p380022fb00e655b8b4462fe862ccf6c45~RsrJ4OnTk0546505465epcas5p3j; Thu, 3 Sep 2026 03:43:26 +0000 (GMT) Received: from [107.122.5.126] (unknown [107.122.5.126]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20260903034324epsmtip19d32848c86f1eb6807590d3a4e492a0c~RsrHrhGP81548715487epsmtip1D; Thu, 3 Sep 2026 03:43:24 +0000 (GMT) Message-ID: Date: Thu, 3 Sep 2026 09:13:13 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent OOB access To: =?UTF-8?B?xYF1a2FzeiBMZWJpZWR6acWEc2tp?= Cc: akash.m5@samsung.com, alim.akhtar@samsung.com, andre.draszik@linaro.org, dh10.jung@samsung.com, jh0801.jung@samsung.com, krzk@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-samsung-soc@vger.kernel.org, muhammed.ali@samsung.com, neil.armstrong@linaro.org, peter.griffin@linaro.org, pritam.sutar@samsung.com, thiagu.r@samsung.com, vkoul@kernel.org Content-Language: en-US From: Selvarasu Ganesan In-Reply-To: <20260902000439.25379-1-kernel@lvkasz.us> X-CMS-MailID: 20260903034326epcas5p380022fb00e655b8b4462fe862ccf6c45 X-Msg-Generator: CA CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20260903034326epcas5p380022fb00e655b8b4462fe862ccf6c45 References: <20260831070309.158069-1-selvarasu.g@samsung.com> <20260902000439.25379-1-kernel@lvkasz.us> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260902_204338_342207_B11EA456 X-CRM114-Status: GOOD ( 13.98 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-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lcnMgcmVzb2x2ZSB0byB0 aGUgZXh5bm9zNV8qIHZhcmlhbnRzCj4gaW5zdGVhZCBvZiB0aGUgZXh5bm9zNzg3MCBvbmVzIC0g dGhlIE9PQiByZWFkIGxhbmRzIHJpZ2h0IG9uCj4gdGhlIGFkamFjZW50IHBoeV9jZmdfZXh5bm9z NVtdIGFycmF5IGluIC5yb2RhdGEuIE5vIGNyYXNoIG9jY3Vycywgc2luY2UKPiB0aGVzZSBnYXJi YWdlIHBvaW50ZXJzIGhhcHBlbiB0byBwb2ludCB0byB2YWxpZCAodGhvdWdoIHVucmVsYXRlZCkK PiBrZXJuZWwgZnVuY3Rpb25zIHJhdGhlciB0aGFuIHNvbWV0aGluZyBpbnZhbGlkLgo+Cj4gV2l0 aCB0aGUgcGF0Y2ggYXBwbGllZCwgdGhlIHNhbWUgZGVidWcgcHJpbnQgc2hvd3MgdGhlIGxvb3Ag Y29ycmVjdGx5Cj4gc3RvcHBpbmcgYXQgbl9waHlfY2ZnPTE7IGk9MSBpcyBuZXZlciByZWFjaGVk LiBCb290IGFuZCBVU0IgYm90aCB3b3JrCj4gZmluZSBvbiB0aGUgYWN0dWFsIFBIWSBpbmRleCAo MCkuCj4KPiBUZXN0ZWQtYnk6IMWBdWthc3ogTGViaWVkemnFhHNraSA8a2VybmVsQGx2a2Fzei51 cz4KClRoYW5rcyBmb3IgeW91ciB0ZXN0aW5nIGFuZCB1cGRhdGUuCgpUaGFua3MsClNlbHZhCj4K Ci0tIApsaW51eC1waHkgbWFpbGluZyBsaXN0CmxpbnV4LXBoeUBsaXN0cy5pbmZyYWRlYWQub3Jn Cmh0dHBzOi8vbGlzdHMuaW5mcmFkZWFkLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2xpbnV4LXBoeQo= 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 A6F7CC61DD3 for ; Thu, 3 Sep 2026 03:43:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:References:Content-Type: Content-Transfer-Encoding:In-Reply-To:From: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=hxQCmTNMct1DRhOL2zkVSmPzrkHNVIa3V+xEsZNmDLo=; b=nktSbYul/ZomwcEv84+5GgPJH9 qEMrpdHGqemX9KYeu2fNiTuL+5vjt8Pigs+7nmJ/xsngzjaB3sG7ch6pP3raaw+kDU5CAt16ld+tF n1IjCeGn5jlZGyVi+lovMPsL3aMdb+TGUjEEqbKiaeqBQNyCMTZ9M+uWDJc7jIiKoeIKqU1G/plIs 01Ol3ymMDaCGLNJAval18beB0XXdHEQKiEtccGskihsikj1N8q0kTWJxk9g5idOpRg8je79iNNW4B VhTa/QDzT43um4xybQC3+pkgTuHbbUW8TojXpeIr/InI7PSMovEDuslAJ7ducBGxvUVBWh2PdvKGN 8tfaX9dw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1yMa-0000000GI6V-3Igp; Thu, 03 Sep 2026 03:43:44 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x1yMT-0000000GI54-2jn9 for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2026 03:43:43 +0000 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20260903034328epoutp043f7ae32b8853e4c8b441bb5d7094afaf~RsrLtS0K92513625136epoutp04b for ; Thu, 3 Sep 2026 03:43:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20260903034328epoutp043f7ae32b8853e4c8b441bb5d7094afaf~RsrLtS0K92513625136epoutp04b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1788407008; bh=hxQCmTNMct1DRhOL2zkVSmPzrkHNVIa3V+xEsZNmDLo=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=X55mDB+o3vq/x9sQQI0kgJmccvhvqmrDBVLetGnJ5rysGFps+x9Z5pg7e7DEXHRPL 2/0SyS3NM44wZzXZXqvahQaKVflAHUL/zLeWNphMMxl2hTsWm6SPg144C/7xDZOZAj sP9cSdln4Wrv0RDmhF5uwlfamEGNLhGR+3orqEH0= Received: from epsnrtp04.localdomain (unknown [182.195.42.156]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPS id 20260903034328epcas5p2d368d9a3526cfa324b3ace3ce9cf3757~RsrLRYlZE1311513115epcas5p2y; Thu, 3 Sep 2026 03:43:28 +0000 (GMT) Received: from epcas5p3.samsung.com (unknown [182.195.38.90]) by epsnrtp04.localdomain (Postfix) with ESMTP id 4hb56R0c1hz6B9m5; Thu, 3 Sep 2026 03:43:27 +0000 (GMT) Received: from epsmtip1.samsung.com (unknown [182.195.34.30]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20260903034326epcas5p380022fb00e655b8b4462fe862ccf6c45~RsrJ4OnTk0546505465epcas5p3j; Thu, 3 Sep 2026 03:43:26 +0000 (GMT) Received: from [107.122.5.126] (unknown [107.122.5.126]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20260903034324epsmtip19d32848c86f1eb6807590d3a4e492a0c~RsrHrhGP81548715487epsmtip1D; Thu, 3 Sep 2026 03:43:24 +0000 (GMT) Message-ID: Date: Thu, 3 Sep 2026 09:13:13 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent OOB access To: =?UTF-8?B?xYF1a2FzeiBMZWJpZWR6acWEc2tp?= Cc: akash.m5@samsung.com, alim.akhtar@samsung.com, andre.draszik@linaro.org, dh10.jung@samsung.com, jh0801.jung@samsung.com, krzk@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-samsung-soc@vger.kernel.org, muhammed.ali@samsung.com, neil.armstrong@linaro.org, peter.griffin@linaro.org, pritam.sutar@samsung.com, thiagu.r@samsung.com, vkoul@kernel.org Content-Language: en-US From: Selvarasu Ganesan In-Reply-To: <20260902000439.25379-1-kernel@lvkasz.us> Content-Transfer-Encoding: 8bit X-CMS-MailID: 20260903034326epcas5p380022fb00e655b8b4462fe862ccf6c45 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20260903034326epcas5p380022fb00e655b8b4462fe862ccf6c45 References: <20260831070309.158069-1-selvarasu.g@samsung.com> <20260902000439.25379-1-kernel@lvkasz.us> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260902_204338_341809_1D9A7E39 X-CRM114-Status: GOOD ( 15.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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 9/2/2026 5:34 AM, Łukasz Lebiedziński wrote: > I tested this on my Samsung Galaxy A6 (Exynos7870) with this patch applied > on top of mainline. I wanted to verify the OOB read first before trusting > this fix, so I forced the device tree to request PHY index 1 > (phys = <&usbdrd_phy 1>;) - this index does not exist for this SoC, > because the phy_cfg_exynos7870[] array contains only one entry. I added > a temporary pr_info() call after assigning phy_cfg in the probe loop to > display the phy_isol/phy_init values using %pS: > > i=0 phy_isol=exynos7870_usbdrd_phy_isol+0x0/0x60 > phy_init=exynos7870_usbdrd_utmi_init+0x0/0x260 > i=1 phy_isol=exynos5_usbdrd_phy_isol+0x0/0x50 > phy_init=exynos5_usbdrd_utmi_init+0x0/0xc8 > > For i=1, both function pointers resolve to the exynos5_* variants > instead of the exynos7870 ones - the OOB read lands right on > the adjacent phy_cfg_exynos5[] array in .rodata. No crash occurs, since > these garbage pointers happen to point to valid (though unrelated) > kernel functions rather than something invalid. > > With the patch applied, the same debug print shows the loop correctly > stopping at n_phy_cfg=1; i=1 is never reached. Boot and USB both work > fine on the actual PHY index (0). > > Tested-by: Łukasz Lebiedziński Thanks for your testing and update. Thanks, Selva >