Thread (102 messages) flat view 102 messages, 3 authors, 4d ago

Re: [PATCH v11 14/74] drm/bridge: Fix unlocked list access in drm_bridge_attach()

From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
Date: 2026-09-21 16:52:07
Also in: dri-devel, linux-arm-kernel, linux-rockchip, linux-sunxi, lkml

On Mon Sep 21, 2026 at 9:23 AM CEST, Luca Ceresoli wrote:
On Tue Sep 1, 2026 at 8:50 PM CEST, Cristian Ciocaltea wrote:
quoted
drm_bridge_attach() inspects bridge->list to warn about bridges being
attached without a previous drm_bridge_add() call, but it does so
without holding bridge_lock.

The list head can be concurrently written by drm_bridge_add(),
drm_bridge_remove() and __drm_bridge_free() while they operate on
neighbouring entries of bridge_list or bridge_lingering_list, all of
them under bridge_lock.  Hence the unlocked read is a data race, even
though it is unlikely to change the outcome of list_empty() in practice.

Perform the check with bridge_lock held.

Fixes: 76f1a9711b83 ("drm/bridge: add warning for bridges attached without being added")
Signed-off-by: Cristian Ciocaltea <redacted>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
And tested with bridge hotplug:
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help