diff options
| author | Kuniyuki Iwashima <kuniyu@google.com> | 2026-07-03 00:09:23 +0000 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-07-11 12:57:50 +0200 |
| commit | aabbdb8c76d7b912d9a6bb2b1e835eba54a53a8d (patch) | |
| tree | ba4239adf7f7bc0600afef2b94a0c082aabdee75 /include/linux | |
| parent | acb351b5a899a45400daa154258d970077658848 (diff) | |
ipvlan: Synchronise ipvlan_init() and ipvlan_uninit() for the same lower dev.
ipvlan_uninit() for the last ipvlan device resets the lower device's
rx_handler_data to NULL.
Once RTNL is removed, ipvlan_init() would race with ipvlan_uninit(),
which could leak a newly allocated ipvl_port.
ipvlan_init() ipvlan_uninit()
| |- if (refcount_dec_and_test(old_port))
... |- ipvlan_port_destroy(old_port)
| '
|- refcount_inc_not_zero(old_port) <-- fails
|- ipvlan_port_create(phy_dev) .
|- new_port = kzalloc() |
|- phy_dev->rx_handler_data = new_port
|- phy_dev->rx_handler_data = NULL
...
`- kfree(old_port);
Let's synchronise the two by holding the lower device's netdev_lock().
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260703001009.1572444-13-kuniyu@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
