summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@google.com>2026-07-03 00:09:22 +0000
committerPaolo Abeni <pabeni@redhat.com>2026-07-11 12:57:50 +0200
commitacb351b5a899a45400daa154258d970077658848 (patch)
tree5963c90571f452e0b206c79afab9679091641637 /include/linux
parentf1de92507a91ea99831461721714c44fa39ddd77 (diff)
ipvlan: Convert ipvl_port.count to refcount_t.
struct ipvl_port is shared between a lower device and its upper ipvlan devices. While each upper device can always access ipvl_port safely via ipvlan_dev.port, the lower device relies on RTNL to access it via net_device.rx_handler_data. Once RTNL is removed, the lower device cannot read ipvl_port safely in ipvlan_device_event() because the port could be freed concurrently and net_device.rx_handler_data is set to NULL if the last ipvlan device in another namespace is unregistered. Let's convert ipvl_port.count to refcount_t and use RCU along with refcount_inc_not_zero() in ipvlan_device_event(). netdev_put() in ipvlan_port_destroy() is also moved down after cancel_work_sync(), which is the last user of port->dev. Note that ipvlan->port is now set in ipvlan_init() so that it can be used in ipvlan_uninit(), instead of ipvlan_port_get_rtnl() (rtnl_dereference()). Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20260703001009.1572444-12-kuniyu@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions