Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Selvarasu Ganesan <selvarasu.g@samsung.com>
Cc: vkoul@kernel.org, neil.armstrong@linaro.org, krzk@kernel.org,
	 peter.griffin@linaro.org, alim.akhtar@samsung.com,
	pritam.sutar@samsung.com,  andre.draszik@linaro.org,
	kernel@lvkasz.us, pengpeng@iscas.ac.cn,
	 linux-phy@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	jh0801.jung@samsung.com,  h10.kim@samsung.com,
	dh10.jung@samsung.com, akash.m5@samsung.com,
	 hongpooh.kim@samsung.com, eomji.oh@samsung.com,
	shijie.cai@samsung.com,  muhammed.ali@samsung.com,
	thiagu.r@samsung.com
Subject: Re: [PATCH v2] phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent OOB access
Date: Mon, 12 Oct 2026 21:44:07 +0530	[thread overview]
Message-ID: <as0G-bk_TKRToOkv@debian> (raw)
In-Reply-To: <20260918103147.2628614-1-selvarasu.g@samsung.com>

On Fri, Sep 18, 2026 at 04:01:47PM +0530, Selvarasu Ganesan wrote:
> The probe loop currently iterates using EXYNOS5_DRDPHYS_NUM (2),
> creating both UTMI and PIPE3 PHY instances regardless of the SoC
> capability. Several SoCs (Exynos2200, Exynos7870, Exynos850, Exynos990,
> and ExynosAutoV920) provide phy_cfg arrays containing only a single
> element.
> 
> On these SoCs, when the loop reaches index 1, the driver reads past the
> end of the rodata array, populating the second PHY instance with garbage
> data. Since the configuration structure contains critical function
> pointers (phy_isol, phy_init, set_refclk), any subsequent access to this
> PHY instance via exynos5_usbdrd_phy_xlate could result in a kernel oops.
> 
> Fix this by adding 'n_phy_cfg' to struct exynos5_usbdrd_phy_drvdata to
> store the actual size of the phy_cfg array for each SoC. Update the
> probe loop and the xlate function to bound their access against this
> value instead of the hardcoded EXYNOS5_DRDPHYS_NUM.
> 
> Assisted-by: LLM
> Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
> Tested-by: Łukasz Lebiedziński <kernel@lvkasz.us>
> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
> Reviewed-by: André Draszik <andre.draszik@linaro.org>
> Reviewed-by: Peter Griffin <peter.griffin@linaro.org>

Since this patch fixes an OOB issue, it should have a Fixes tag and the stable
list should be CCed for backporting.

- Mani

-- 
மணிவண்ணன் சதாசிவம்

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

      reply	other threads:[~2026-10-12 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260918103249epcas5p49c9b4bf6fd60c28f5f09f0b7b69828b6@epcas5p4.samsung.com>
2026-09-18 10:31 ` [PATCH v2] phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent OOB access Selvarasu Ganesan
2026-10-12 16:14   ` Manivannan Sadhasivam [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=as0G-bk_TKRToOkv@debian \
    --to=mani@kernel.org \
    --cc=akash.m5@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andre.draszik@linaro.org \
    --cc=dh10.jung@samsung.com \
    --cc=eomji.oh@samsung.com \
    --cc=h10.kim@samsung.com \
    --cc=hongpooh.kim@samsung.com \
    --cc=jh0801.jung@samsung.com \
    --cc=kernel@lvkasz.us \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=muhammed.ali@samsung.com \
    --cc=neil.armstrong@linaro.org \
    --cc=pengpeng@iscas.ac.cn \
    --cc=peter.griffin@linaro.org \
    --cc=pritam.sutar@samsung.com \
    --cc=selvarasu.g@samsung.com \
    --cc=shijie.cai@samsung.com \
    --cc=thiagu.r@samsung.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox