]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm/dsi: fix memory corruption with too many bridges
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 13 Sep 2022 08:53:13 +0000 (10:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:56:53 +0000 (23:56 +0900)
commit63a02973975f8b3f8cc97b420937827515a6f691
tree47481b5ec03a79f7633b3f045a524bdc5b13979e
parentb1c566f3d98cfb67e7da52399401d5a7a50c33c7
drm/msm/dsi: fix memory corruption with too many bridges

commit 24ceadf7f6761a8c680bf0777e128b7ea75773ab upstream.

Add the missing sanity check on the bridge counter to avoid corrupting
data beyond the fixed-sized bridge array in case there are ever more
than eight bridges.

Fixes: 7dd12de536b2 ("drm/msm: Initial add DSI connector support")
Cc: stable@vger.kernel.org # 4.1
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/502668/
Link: https://lore.kernel.org/r/20220913085320.8577-4-johan+linaro@kernel.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/msm/dsi/dsi.c