Re: [PATCH net] net: hsr: free learned nodes on device setup failure

From
patchwork-bot+netdevbpf@kernel.org
Date
2026-08-17 21:10:56
Also in
lkml
Reply to
Xin Xie, 2026-08-08
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski [off-list ref]:

On Sat,  8 Aug 2026 13:08:14 +0200 you wrote:
hsr_dev_finalize() can fail after a lower-device RX handler has
already been registered (slave A is added before the failable slave B
and interlink adds). RX handlers run in softirq regardless of the
master's state, so frames received in that window can learn dynamic
nodes into node_db, and the error unwind never releases them.

Free both owned dynamic databases in the unwind, mirroring
hsr_dellink(). proxy_node_db is provably empty on every current error
exit (only interlink RX feeds it, and the interlink add is the last
failable step) and is freed for symmetry. The order is safe:
hsr_del_port() unregisters each RX handler with synchronize_net()
before hsr_del_nodes() runs, which removes remaining entries with
list_del_rcu() and defers their release with call_rcu() for readers
already under RCU.

[...]
Here is the summary with links:
  - [net] net: hsr: free learned nodes on device setup failure
    https://git.kernel.org/netdev/net/c/7f16289b91eb

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Thread (5 messages) 5 messages, 3 authors, last reply 2026-08-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help