phy: qcom-qmp-combo: fix out-of-bounds clock access
authorJohan Hovold <johan+linaro@kernel.org>
Mon, 14 Nov 2022 08:13:41 +0000 (09:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jan 2023 10:11:38 +0000 (11:11 +0100)
commit9ebb4f4eab19116619e40d0aa8fbba955512eea1
tree0b59fd1190377f4503e22f2f9234e8beb8d2fac0
parent39eeec3130a1367f527093b36010e6605d618564
phy: qcom-qmp-combo: fix out-of-bounds clock access

commit d8a5b59c5fc75c99ba17e3eb1a8f580d8d172b28 upstream.

The SM8250 only uses three clocks but the DP configuration erroneously
described four clocks.

In case the DP part of the PHY is initialised before the USB part, this
would lead to uninitialised memory beyond the bulk-clocks array to be
treated as a clock pointer as the clocks are requested based on the USB
configuration.

Fixes: aff188feb5e1 ("phy: qcom-qmp: add support for sm8250-usb3-dp phy")
Cc: stable@vger.kernel.org # 5.13
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20221114081346.5116-2-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/phy/qualcomm/phy-qcom-qmp-combo.c