Skip to content

Commit 6808abd

Browse files
jhovoldAbhinav Kumar
authored andcommitted
drm/msm: fix use-after-free on probe deferral
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: d28ea55 ("drm/msm: properly add and remove internal bridges") Fixes: a3376e3 ("drm/msm: convert to drm_bridge") Cc: [email protected] # 3.12 Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Tested-by: Kuogee Hsieh <[email protected]> Reviewed-by: Kuogee Hsieh <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/502665/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abhinav Kumar <[email protected]>
1 parent 0b33a33 commit 6808abd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/msm/msm_drv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ static int msm_drm_uninit(struct device *dev)
247247

248248
for (i = 0; i < priv->num_bridges; i++)
249249
drm_bridge_remove(priv->bridges[i]);
250+
priv->num_bridges = 0;
250251

251252
pm_runtime_get_sync(dev);
252253
msm_irq_uninstall(ddev);

0 commit comments

Comments
 (0)