• Cong Wang's avatar
    hsr: switch ->dellink() to ->ndo_uninit() · 311633b6
    Cong Wang authored
    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: 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>
    311633b6
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
hsr_debugfs.c Loading commit data...
hsr_device.c Loading commit data...
hsr_device.h Loading commit data...
hsr_forward.c Loading commit data...
hsr_forward.h Loading commit data...
hsr_framereg.c Loading commit data...
hsr_framereg.h Loading commit data...
hsr_main.c Loading commit data...
hsr_main.h Loading commit data...
hsr_netlink.c Loading commit data...
hsr_netlink.h Loading commit data...
hsr_slave.c Loading commit data...
hsr_slave.h Loading commit data...