Skip to content
Commit 4d896602 authored by Cong Wang's avatar Cong Wang Committed by Greg Kroah-Hartman
Browse files

hsr: switch ->dellink() to ->ndo_uninit()

[ Upstream commit 311633b6 ]

Switching from ->priv_destructor to dellink() has an unexpected
consequence: existing RCU readers, that is, hsr_port_get_hsr()
callers, may still be able to read the port list.

Instead of checking the return value of each hsr_port_get_hsr(),
we can just move it to ->ndo_uninit() which is called after
device unregister and synchronize_net(), and we still have RTNL
lock there.

Fixes: b9a1e627 ("hsr: implement dellink to clean up resources")
Fixes: edf070a0

 ("hsr: fix a NULL pointer deref in hsr_dev_xmit()")
Reported-by: default avatar <syzbot+097ef84cdc95843fbaa8@syzkaller.appspotmail.com>
Cc: Arvid Brodin <arvid.brodin@alten.se>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 072c9337
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment