[PATCH 1/3] phy: samsung: gs101-ufs: terminate pre_pwr_hs config
Peter Griffin
peter.griffin at linaro.org
Tue Dec 1 07:28:01 PST 2026
On Fri, 27 Nov 2026 at 10:40, André Draszik <andre.draszik at linaro.org> wrote:
>
> Booting a gs101 platform with KASAN triggers a global-out-of-bounds
> read during UFS PHY calibration:
>
> BUG: KASAN: global-out-of-bounds in
> samsung_ufs_phy_calibrate+0x144/0x530
> Read of size 1 at addr ffff8000825a894d by task (udev-worker)/179
> Call trace:
> kasan_report+0xb0/0x108
> __asan_load1+0x98/0xa0
> samsung_ufs_phy_calibrate+0x144/0x530
> phy_calibrate+0x70/0xc0
> exynos_ufs_pre_pwr_mode+0x280/0x2b0 [ufs_exynos]
> exynos_ufs_pwr_change_notify+0x208/0x2b8 [ufs_exynos]
> ufshcd_change_power_mode+0x58/0xd0
> ufshcd_config_pwr_mode+0xf4/0x1f0
> ufshcd_post_device_init+0x2fc/0x4c8
> ufshcd_init+0x12bc/0x18a0
> ufshcd_pltfrm_init+0x200/0x3d0
> exynos_ufs_probe+0x48/0xa0 [ufs_exynos]
> The buggy address belongs to the variable:
> tensor_gs101_pre_pwr_hs_config+0x2d/0x40
>
> samsung_ufs_phy_calibrate() iterates through each configuration table
> with for_each_phy_cfg(), stopping only when cfg->id is 0.
> tensor_gs101_pre_pwr_hs_config[] omits the END_UFS_PHY_CFG sentinel,
> so the loop reads past the end of the two-element array into adjacent
> memory (offset 0x2d is cfg[2].id).
>
> Add the missing END_UFS_PHY_CFG terminator to
> tensor_gs101_pre_pwr_hs_config[].
>
> Fixes: c1cf725db106 ("phy: samsung-ufs: ufs: Add support for gs101 UFS phy tuning")
> Cc: stable at vger.kernel.org
> Signed-off-by: André Draszik <andre.draszik at linaro.org>
> ---
Reviewed-by: Peter Griffin <peter.griffin at linaro.org>
> drivers/phy/samsung/phy-gs101-ufs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/phy/samsung/phy-gs101-ufs.c b/drivers/phy/samsung/phy-gs101-ufs.c
> index a15e1f453f7f..d4af94f3fed4 100644
> --- a/drivers/phy/samsung/phy-gs101-ufs.c
> +++ b/drivers/phy/samsung/phy-gs101-ufs.c
> @@ -98,6 +98,7 @@ static const struct samsung_ufs_phy_cfg tensor_gs101_pre_init_cfg[] = {
> static const struct samsung_ufs_phy_cfg tensor_gs101_pre_pwr_hs_config[] = {
> PHY_TRSV_REG_CFG_GS101(0x369, 0x11, PWR_MODE_ANY),
> PHY_TRSV_REG_CFG_GS101(0x246, 0x03, PWR_MODE_ANY),
> + END_UFS_PHY_CFG,
> };
>
> /* Calibration for HS mode series A/B */
>
> --
> 2.56.1.839.g22a8290db9-goog
>
More information about the linux-arm-kernel
mailing list