linux-stable/drivers/phy
Harshit Mogalapalli 01cb355bb9 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:23:59 +02:00
..
allwinner
amlogic phy: amlogic: phy-meson-g12a-mipi-dphy-analog: fix CNTL2_DIF_TX_CTL0 value 2023-06-09 10:33:58 +02:00
broadcom phy: phy-brcm-usb: Utilize platform_get_irq_byname_optional() 2023-05-01 08:26:27 +09:00
cadence
freescale
hisilicon phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() 2023-08-03 10:23:59 +02:00
ingenic
intel
lantiq
marvell
mediatek phy: phy-mtk-dp: Fix an error code in probe() 2023-08-03 10:23:56 +02:00
microchip
motorola
mscc
qualcomm phy: qcom-snps-femto-v2: properly enable ref clock 2023-08-03 10:23:57 +02:00
ralink
renesas
rockchip phy: rockchip-typec: Fix unsigned comparison with less than zero 2023-03-11 13:55:40 +01:00
samsung
socionext
st phy: st: miphy28lp: use _poll_timeout functions for waits 2023-05-24 17:32:41 +01:00
sunplus phy: usb: sunplus: Fix potential null-ptr-deref in sp_usb_phy_probe() 2023-02-01 08:34:09 +01:00
tegra phy: tegra: xusb: check return value of devm_kzalloc() 2023-07-19 16:21:58 +02:00
ti phy: ti: j721e-wiz: Fix unreachable code in wiz_mode_select() 2023-05-11 23:03:37 +09:00
xilinx
Kconfig
Makefile
phy-can-transceiver.c phy: phy-can-transceiver: Skip warning if no "max-bitrate" 2023-02-01 08:34:25 +01:00
phy-core-mipi-dphy.c
phy-core.c
phy-lgm-usb.c
phy-lpc18xx-usb-otg.c
phy-pistachio-usb.c
phy-xgene.c