]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bridge: stp: Fix a potential use-after-free when deleting a bridge
authorIdo Schimmel <idosch@nvidia.com>
Mon, 29 Jun 2026 07:21:17 +0000 (10:21 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 30 Jun 2026 13:14:35 +0000 (15:14 +0200)
commit2a00517db8de4be7df3d483b215c5544fb30a191
treeba59a665168c011885462079eac2977b095aa898
parente5b811fe793166aecc59b085c1b7c31262ef2316
bridge: stp: Fix a potential use-after-free when deleting a bridge

The three STP timers are not supposed to be armed while the bridge is
administratively down. They are synchronously deactivated when the
bridge is put administratively down and the various call sites check for
'IFF_UP' before arming them.

This check is missing from br_topology_change_detection() and it is
possible to engineer a situation in which the topology change timer is
armed while the bridge is administratively down, resulting in a
use-after-free [1] when the bridge is deleted.

Fix by adding the missing check and for good measures synchronously
shutdown the three timers when the bridge is deleted.

[1]
ODEBUG: free active (active state 0) object: ffff88811662b9b0 object type: timer_list hint: br_topology_change_timer_expired (net/bridge/br_stp_timer.c:120)
WARNING: lib/debugobjects.c:629 at debug_print_object+0x1bc/0x450, CPU#9: ip/359

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Noam Rathaus <noamr@ssd-disclosure.com>
Reported-by: Neil Young <contact@ssd-disclosure.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260629072117.497959-1-idosch@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/bridge/br_if.c
net/bridge/br_stp.c