linux/net
Robert Shearman 0fae3bf018 mpls: handle device renames for per-device sysctls
If a device is renamed and the original name is subsequently reused
for a new device, the following warning is generated:

sysctl duplicate entry: /net/mpls/conf/veth0//input
CPU: 3 PID: 1379 Comm: ip Not tainted 4.1.0-rc4+ #20
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
 0000000000000000 0000000000000000 ffffffff81566aaf 0000000000000000
 ffffffff81236279 ffff88002f7d7f00 0000000000000000 ffff88000db336d8
 ffff88000db33698 0000000000000005 ffff88002e046000 ffff8800168c9280
Call Trace:
 [<ffffffff81566aaf>] ? dump_stack+0x40/0x50
 [<ffffffff81236279>] ? __register_sysctl_table+0x289/0x5a0
 [<ffffffffa051a24f>] ? mpls_dev_notify+0x1ff/0x300 [mpls_router]
 [<ffffffff8108db7f>] ? notifier_call_chain+0x4f/0x70
 [<ffffffff81470e72>] ? register_netdevice+0x2b2/0x480
 [<ffffffffa0524748>] ? veth_newlink+0x178/0x2d3 [veth]
 [<ffffffff8147f84c>] ? rtnl_newlink+0x73c/0x8e0
 [<ffffffff8147f27a>] ? rtnl_newlink+0x16a/0x8e0
 [<ffffffff81459ff2>] ? __kmalloc_reserve.isra.30+0x32/0x90
 [<ffffffff8147ccfd>] ? rtnetlink_rcv_msg+0x8d/0x250
 [<ffffffff8145b027>] ? __alloc_skb+0x47/0x1f0
 [<ffffffff8149badb>] ? __netlink_lookup+0xab/0xe0
 [<ffffffff8147cc70>] ? rtnetlink_rcv+0x30/0x30
 [<ffffffff8149e7a0>] ? netlink_rcv_skb+0xb0/0xd0
 [<ffffffff8147cc64>] ? rtnetlink_rcv+0x24/0x30
 [<ffffffff8149df17>] ? netlink_unicast+0x107/0x1a0
 [<ffffffff8149e4be>] ? netlink_sendmsg+0x50e/0x630
 [<ffffffff8145209c>] ? sock_sendmsg+0x3c/0x50
 [<ffffffff81452beb>] ? ___sys_sendmsg+0x27b/0x290
 [<ffffffff811bd258>] ? mem_cgroup_try_charge+0x88/0x110
 [<ffffffff811bd5b6>] ? mem_cgroup_commit_charge+0x56/0xa0
 [<ffffffff811d7700>] ? do_filp_open+0x30/0xa0
 [<ffffffff8145336e>] ? __sys_sendmsg+0x3e/0x80
 [<ffffffff8156c3f2>] ? system_call_fastpath+0x16/0x75

Fix this by unregistering the previous sysctl table (registered for
the path containing the original device name) and re-registering the
table for the path containing the new device name.

Fixes: 37bde79979 ("mpls: Per-device enabling of packet input")
Reported-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Robert Shearman <rshearma@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-06-11 16:47:16 -07:00
..
6lowpan
9p 9p: patches for 4.1 merge window 2015-04-18 17:45:30 -04:00
802
8021q vlan: Correctly propagate promisc|allmulti flags in notifier. 2015-05-14 00:54:32 -04:00
appletalk
atm
ax25
batman-adv
bluetooth Bluetooth: Fix remote name event return directly. 2015-05-14 10:35:04 +02:00
bridge bridge: fix multicast router rlist endless loop 2015-06-10 22:07:50 -07:00
caif unix/caif: sk_socket can disappear when state is unlocked 2015-05-26 23:19:29 -04:00
can
ceph Revert "libceph: clear r_req_lru_item in __unregister_linger_request()" 2015-05-20 21:02:46 +03:00
core net, swap: Remove a warning and clarify why sk_mem_reclaim is required when deactivating swap 2015-06-10 23:02:31 -07:00
dcb
dccp inet: fix possible panic in reqsk_queue_unlink() 2015-04-24 11:39:15 -04:00
decnet
dns_resolver
dsa net: dsa: Properly propagate errors from dsa_switch_setup_one 2015-05-31 21:50:34 -07:00
ethernet
hsr
ieee802154 ieee802154: trace: fix endian convertion 2015-04-30 18:48:11 +02:00
ipv4 ipv4/udp: Verify multicast group is ours in upd_v4_early_demux() 2015-06-04 00:46:26 -07:00
ipv6 Revert "ipv6: Fix protocol resubmission" 2015-06-10 15:29:31 -07:00
ipx
irda
iucv
key
l2tp
lapb
llc
mac80211 mac80211: fix AP_VLAN crypto tailroom calculation 2015-05-20 15:10:11 +02:00
mac802154 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth 2015-05-09 15:51:00 -04:00
mpls mpls: handle device renames for per-device sysctls 2015-06-11 16:47:16 -07:00
netfilter netfilter: nfnetlink_{log,queue}: Register pernet in first place 2015-05-20 13:46:48 +02:00
netlabel
netlink netlink: Reset portid after netlink_insert failure 2015-05-16 17:08:57 -04:00
netrom
nfc
openvswitch openvswitch: disable LRO 2015-06-03 19:39:35 -07:00
packet af_packet / TX_RING not fully non-blocking (w/ MSG_DONTWAIT). 2015-05-10 19:40:08 -04:00
phonet
rds net/rds: RDS-TCP: only initiate reconnect attempt on outgoing TCP socket. 2015-05-09 16:03:28 -04:00
rfkill
rose
rxrpc
sched net_sched: invoke ->attach() after setting dev->qdisc 2015-05-27 14:09:55 -04:00
sctp
sunrpc svcrpc: fix potential GSSX_ACCEPT_SEC_CONTEXT decoding failures 2015-05-04 12:02:40 -04:00
switchdev rename RTNH_F_EXTERNAL to RTNH_F_OFFLOAD 2015-05-14 22:45:39 -04:00
tipc tipc: disconnect socket directly after probe failure 2015-06-10 22:05:20 -07:00
unix unix/caif: sk_socket can disappear when state is unlocked 2015-05-26 23:19:29 -04:00
vmw_vsock
wimax
wireless cfg80211: wext: clear sinfo struct before calling driver 2015-06-09 13:54:58 -07:00
x25
xfrm xfrm: Override skb->mark with tunnel->parm.i_key in xfrm_input 2015-05-28 06:23:31 +02:00
compat.c
Kconfig
Makefile
socket.c
sysctl_net.c