Skip to content
Commit 4c75431a authored by Alexander Y. Fomichev's avatar Alexander Y. Fomichev Committed by David S. Miller
Browse files

net: prevent of emerging cross-namespace symlinks



Code manipulating sysfs symlinks on adjacent net_devices(s)
currently doesn't take into account that devices potentially
belong to different namespaces.

This patch trying to fix an issue as follows:
- check for net_ns before creating / deleting symlink.
  for now only netdev_adjacent_rename_links and
  __netdev_adjacent_dev_remove are affected, afaics
  __netdev_adjacent_dev_insert implies both net_devs
  belong to the same namespace.
- Drop all existing symlinks to / from all adj_devs before
  switching namespace and recreate them just after.

Signed-off-by: default avatarAlexander Y. Fomichev <git.user@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a45e92a5
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