WSL2-Linux-Kernel/drivers/phy/hisilicon
Harshit Mogalapalli 6d8a71e4c3 phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe()
[ Upstream commit 13c088cf36 ]

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

Fixes: ba8b0ee81f ("phy: add inno-usb2-phy driver for hi3798cv200 SoC")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20230721090558.3588613-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-03 10:22:34 +02:00
..
Kconfig phy: phy-hi3670-usb3: move driver from staging into phy 2021-06-25 10:02:02 +02:00
Makefile phy: phy-hi3670-usb3: move driver from staging into phy 2021-06-25 10:02:02 +02:00
phy-hi3660-usb3.c phy: hisilicon; Constify hi3660_phy_ops 2020-08-31 14:36:36 +05:30
phy-hi3670-usb3.c phy: phy-hi3670-usb3: move driver from staging into phy 2021-06-25 10:02:02 +02:00
phy-hi6220-usb.c phy: hisilicon: Use the correct HiSilicon copyright 2021-04-06 10:35:51 +05:30
phy-hisi-inno-usb2.c phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() 2023-08-03 10:22:34 +02:00
phy-histb-combphy.c phy: hisilicon: use devm_platform_ioremap_resource() to simplify code 2019-10-23 13:20:28 +05:30
phy-hix5hd2-sata.c phy: hisilicon: Use the correct HiSilicon copyright 2021-04-06 10:35:51 +05:30