linux/net/core
WANG Cong cfc44a4d14 net: check dead netns for peernet2id_alloc()
Andrei reports we still allocate netns ID from idr after we destroy
it in cleanup_net().

cleanup_net():
  ...
  idr_destroy(&net->netns_ids);
  ...
  list_for_each_entry_reverse(ops, &pernet_list, list)
    ops_exit_list(ops, &net_exit_list);
      -> rollback_registered_many()
        -> rtmsg_ifinfo_build_skb()
         -> rtnl_fill_ifinfo()
           -> peernet2id_alloc()

After that point we should not even access net->netns_ids, we
should check the death of the current netns as early as we can in
peernet2id_alloc().

For net-next we can consider to avoid sending rtmsg totally,
it is a good optimization for netns teardown path.

Fixes: 0c7aecd4bd ("netns: add rtnl cmd to add and get peer netns ids")
Reported-by: Andrei Vagin <avagin@gmail.com>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-11-17 11:19:40 -05:00
..
datagram.c
dev_addr_lists.c
dev_ioctl.c
dev.c bpf: Fix bpf_redirect to an ipip/ip6tnl dev 2016-11-12 23:38:07 -05:00
devlink.c devlink: add hardware messages tracing facility 2016-07-12 14:20:18 -07:00
drop_monitor.c drop_monitor: make genl_multicast_group const 2016-09-01 14:09:00 -07:00
dst_cache.c
dst.c
ethtool.c
fib_rules.c fib_rules: Added NLM_F_EXCL support to fib_nl_newrule 2016-06-30 08:23:19 -04:00
filter.c bpf: Fix bpf_redirect to an ipip/ip6tnl dev 2016-11-12 23:38:07 -05:00
flow_dissector.c net: __skb_flow_dissect() must cap its return value 2016-11-12 23:41:53 -05:00
flow.c
gen_estimator.c
gen_stats.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-06-10 11:52:24 -07:00
hwbm.c
link_watch.c
lwtunnel.c net: lwtunnel: Handle fragmentation 2016-08-30 22:27:18 -07:00
Makefile
neighbour.c neigh: allow admin to set NUD_STALE 2016-08-08 15:36:38 -07:00
net_namespace.c net: check dead netns for peernet2id_alloc() 2016-11-17 11:19:40 -05:00
net-procfs.c
net-sysfs.c net: introduce NETDEV_CHANGE_TX_QUEUE_LEN 2016-07-01 05:32:17 -04:00
net-sysfs.h
net-traces.c
netclassid_cgroup.c
netevent.c
netpoll.c net: tracepoint napi:napi_poll add work and budget 2016-07-09 18:05:02 -04:00
netprio_cgroup.c
pktgen.c net: pktgen: remove rcu locking in pktgen_change_name() 2016-10-17 10:52:59 -04:00
ptp_classifier.c
request_sock.c
rtnetlink.c rtnetlink: fix rtnl message size computation for XDP 2016-11-15 22:40:07 -05:00
scm.c
secure_seq.c
skbuff.c Merge branch 'work.splice_read' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-07 15:36:58 -07:00
sock_diag.c
sock_reuseport.c soreuseport: do not export reuseport_add_sock() 2016-10-18 14:18:23 -04:00
sock.c dccp: do not release listeners too soon 2016-11-03 16:16:50 -04:00
stream.c net: do not export sk_stream_write_space 2016-09-28 20:32:38 -04:00
sysctl_net_core.c
timestamping.c
tso.c
utils.c net: the space is required before the open parenthesis '(' 2016-06-29 05:15:14 -04:00