All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alim Akhtar" <alim.akhtar@samsung.com>
To: "'Selvarasu Ganesan'" <selvarasu.g@samsung.com>,
	<vkoul@kernel.org>, <neil.armstrong@linaro.org>,
	<krzk@kernel.org>, <peter.griffin@linaro.org>,
	<pritam.sutar@samsung.com>, <andre.draszik@linaro.org>,
	<kernel@lvkasz.us>, <linux-phy@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-samsung-soc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <jh0801.jung@samsung.com>, <dh10.jung@samsung.com>,
	<akash.m5@samsung.com>, <muhammed.ali@samsung.com>,
	<thiagu.r@samsung.com>
Subject: RE: [PATCH] phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent OOB access
Date: Tue, 15 Sep 2026 11:23:58 +0530	[thread overview]
Message-ID: <01e001dd44d6$9c203730$d460a590$@samsung.com> (raw)
In-Reply-To: <20260831070309.158069-1-selvarasu.g@samsung.com>

Hi Selvarasu

> -----Original Message-----
> From: Selvarasu Ganesan <selvarasu.g@samsung.com>
> Sent: Monday, August 31, 2026 12:33 PM
> To: 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;
> linux-phy@lists.infradead.org; linux-arm-kernel@lists.infradead.org; linux-
> samsung-soc@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: jh0801.jung@samsung.com; dh10.jung@samsung.com;
> akash.m5@samsung.com; muhammed.ali@samsung.com;
> thiagu.r@samsung.com; Selvarasu Ganesan <selvarasu.g@samsung.com>
> Subject: [PATCH] phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent
> OOB access
> 
> 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: Claude:claude-sonnet-5
> Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
> ---
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>


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

WARNING: multiple messages have this Message-ID (diff)
From: "Alim Akhtar" <alim.akhtar@samsung.com>
To: "'Selvarasu Ganesan'" <selvarasu.g@samsung.com>,
	<vkoul@kernel.org>, <neil.armstrong@linaro.org>,
	<krzk@kernel.org>, <peter.griffin@linaro.org>,
	<pritam.sutar@samsung.com>, <andre.draszik@linaro.org>,
	<kernel@lvkasz.us>, <linux-phy@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-samsung-soc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <jh0801.jung@samsung.com>, <dh10.jung@samsung.com>,
	<akash.m5@samsung.com>, <muhammed.ali@samsung.com>,
	<thiagu.r@samsung.com>
Subject: RE: [PATCH] phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent OOB access
Date: Tue, 15 Sep 2026 11:23:58 +0530	[thread overview]
Message-ID: <01e001dd44d6$9c203730$d460a590$@samsung.com> (raw)
In-Reply-To: <20260831070309.158069-1-selvarasu.g@samsung.com>

Hi Selvarasu

> -----Original Message-----
> From: Selvarasu Ganesan <selvarasu.g@samsung.com>
> Sent: Monday, August 31, 2026 12:33 PM
> To: 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;
> linux-phy@lists.infradead.org; linux-arm-kernel@lists.infradead.org; linux-
> samsung-soc@vger.kernel.org; linux-kernel@vger.kernel.org
> Cc: jh0801.jung@samsung.com; dh10.jung@samsung.com;
> akash.m5@samsung.com; muhammed.ali@samsung.com;
> thiagu.r@samsung.com; Selvarasu Ganesan <selvarasu.g@samsung.com>
> Subject: [PATCH] phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent
> OOB access
> 
> 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: Claude:claude-sonnet-5
> Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
> ---
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>


  parent reply	other threads:[~2026-09-15  5:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260831070349epcas5p4c62a4e46592dffe95723ddd51a6068e0@epcas5p4.samsung.com>
2026-08-31  7:03 ` [PATCH] phy: exynos5-usbdrd: Use dynamic phy_cfg size to prevent OOB access Selvarasu Ganesan
2026-08-31  7:03   ` Selvarasu Ganesan
2026-09-02  0:04   ` Łukasz Lebiedziński
2026-09-02  0:04     ` Łukasz Lebiedziński
2026-09-03  3:43     ` Selvarasu Ganesan
2026-09-03  3:43       ` Selvarasu Ganesan
2026-09-15  5:53   ` Alim Akhtar [this message]
2026-09-15  5:53     ` Alim Akhtar
2026-09-15 14:38   ` Peter Griffin
2026-09-15 14:38     ` Peter Griffin
2026-09-18  8:34   ` André Draszik
2026-09-18  8:34     ` André Draszik
2026-09-18 10:21     ` Selvarasu Ganesan
2026-09-18 10:21       ` Selvarasu Ganesan

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='01e001dd44d6$9c203730$d460a590$@samsung.com' \
    --to=alim.akhtar@samsung.com \
    --cc=akash.m5@samsung.com \
    --cc=andre.draszik@linaro.org \
    --cc=dh10.jung@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=peter.griffin@linaro.org \
    --cc=pritam.sutar@samsung.com \
    --cc=selvarasu.g@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.