[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <668ebc3a-b731-cd0c-0f60-ba9faabbf978@quicinc.com>
Date: Thu, 22 Sep 2022 12:48:49 -0700
From: Kuogee Hsieh <quic_khsieh@...cinc.com>
To: Johan Hovold <johan+linaro@...nel.org>,
Douglas Anderson <dianders@...omium.org>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
"Rob Clark" <robdclark@...il.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>
CC: <dri-devel@...ts.freedesktop.org>,
Neil Armstrong <neil.armstrong@...aro.org>,
Daniel Vetter <daniel@...ll.ch>,
Jonas Karlman <jonas@...boo.se>,
<linux-arm-msm@...r.kernel.org>,
Bjorn Andersson <andersson@...nel.org>,
<freedreno@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Stephen Boyd <swboyd@...omium.org>,
Robert Foss <robert.foss@...aro.org>,
Andrzej Hajda <andrzej.hajda@...el.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
<stable@...r.kernel.org>, Sean Paul <sean@...rly.run>,
Steev Klimaszewski <steev@...i.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>
Subject: Re: [Freedreno] [PATCH v2 01/10] drm/msm: fix use-after-free on probe
deferral
On 9/13/2022 1:53 AM, Johan Hovold wrote:
> The bridge counter was never reset when tearing down the DRM device so
> that stale pointers to deallocated structures would be accessed on the
> next tear down (e.g. after a second late bind deferral).
>
> Given enough bridges and a few probe deferrals this could currently also
> lead to data beyond the bridge array being corrupted.
>
> Fixes: d28ea556267c ("drm/msm: properly add and remove internal bridges")
> Fixes: a3376e3ec81c ("drm/msm: convert to drm_bridge")
> Cc: stable@...r.kernel.org # 3.12
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> Signed-off-by: Johan Hovold <johan+linaro@...nel.org>
Tested-by: Kuogee Hsieh <quic_khsieh@...cinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@...cinc.com>
> ---
> drivers/gpu/drm/msm/msm_drv.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 391d86b54ded..d254fe2507ec 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -241,6 +241,7 @@ static int msm_drm_uninit(struct device *dev)
>
> for (i = 0; i < priv->num_bridges; i++)
> drm_bridge_remove(priv->bridges[i]);
> + priv->num_bridges = 0;
>
> pm_runtime_get_sync(dev);
> msm_irq_uninstall(ddev);
Powered by blists - more mailing lists