mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
bareudp: Protect bareudp_list with mutex.
struct bareudp_dev.net is the netns where the backend bareudp socket resides. struct bareudp_dev is linked to the bareudp_net.bareudp_list of the socket's netns. During netns dismantle or module unload, bareudp_exit_rtnl_net() iterates the list and queues devices for destruction regardless of the devices' netns. Thus, once RTNL is removed, the list can be modified concurrently from different netns due to device removal. Let's protect it with per-netns mutex. bareudp_newlink() is still protected by rtnl_net_lock()s, so acquiring bn->lock twice in bareudp_find_dev() and bareudp_configure() is not a problem. Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Link: https://patch.msgid.link/20260703001009.1572444-10-kuniyu@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
d7fda2c776
commit
a278ea7ba3
1 changed files with 29 additions and 2 deletions
Loading…
Add table
Add a link
Reference in a new issue