Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 16:53, Sowmini Varadhan wrote: > > Found my previous question: > > https://www.mail-archive.com/netdev@vger.kernel.org/msg72330.html > > (see section about "Comments are specifically ivinted.." I see, thanks. >> This is not a problem, and rds-tcp is not the only pernet_subsys reg

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 17:36, Kirill Tkhai wrote: > On 16.03.2018 16:53, Sowmini Varadhan wrote: >> >> Found my previous question: >> >> https://www.mail-archive.com/netdev@vger.kernel.org/msg72330.html >> >> (see section about "Comments are specifically ivinted

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
e these carefully. If you implement a network device and it > * needs per network namespace operations use device pernet operations, > * otherwise use pernet subsys operations. This is not a strict rule, and currently I'm working on pernet_operations synchronization. This commentary

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 21:31, Sowmini Varadhan wrote: > On (03/16/18 21:14), Kirill Tkhai wrote: >> >> I did the second version and sent you. Have you tried it? > > I tried it briefly, and it works for the handful of testcases > that I tried, but I still think its very werid to reg

Re: [PATCH v2] netns: send uevent messages

2018-03-16 Thread Kirill Tkhai
On 16.03.2018 15:50, Christian Brauner wrote: > This patch adds a receive method to NETLINK_KOBJECT_UEVENT netlink sockets > to allow sending uevent messages into the network namespace the socket > belongs to. > > Currently non-initial network namespaces are already isolated and don't > receive ue

Re: [PATCH net-next 4/5] net: Make ip_ra_chain per struct net

2018-03-17 Thread Kirill Tkhai
us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Kirill-Tkhai/Rework-ip_ra_chain-protection/20180317-032841 > reproduce: > # apt-get install sparse > make ARCH=x86_64 allmodconfig > make C=1 CF=-D__CHEC

Re: [PATCH net-next 0/6] Converting pernet_operations (part #8)

2018-03-17 Thread Kirill Tkhai
On 18.03.2018 00:07, David Miller wrote: > From: Kirill Tkhai > Date: Thu, 15 Mar 2018 12:10:47 +0300 > >> this series continues to review and to convert pernet_operations >> to make them possible to be executed in parallel for several >> net namespaces at the sam

Re: [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-17 Thread Kirill Tkhai
On 17.03.2018 17:15, Sowmini Varadhan wrote: > > I spent a long time staring at both v1 and v2 of your patch. Thanks for your time! > I understand the overall goal, but I am afraid to say that these > patches are complete hacks. I'm not agree with you, see below the explanations. > I was tryi

Re: [rds-devel] [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-17 Thread Kirill Tkhai
On 18.03.2018 00:26, Sowmini Varadhan wrote: > On (03/17/18 10:15), Sowmini Varadhan wrote: >> To solve the scaling problem why not just have a well-defined >> callback to modules when devices are quiesced, instead of >> overloading the pernet_device registration in this obscure way? > > I thoug

[PATCH net-next v2 0/5] Rework ip_ra_chain protection

2018-03-19 Thread Kirill Tkhai
ing (4/5), as reported by kbuild test robot. Kirill Tkhai (5): net: Revert "ipv4: get rid of ip_ra_lock" net: Revert "ipv4: fix a deadlock in ip_ra_control" net: Move IP_ROUTER_ALERT out of lock_sock(sk) net: Make ip_ra_chain per struct net net: Repl

[PATCH net-next v2 2/5] net: Revert "ipv4: fix a deadlock in ip_ra_control"

2018-03-19 Thread Kirill Tkhai
patches in series will rework this in another way, so now we revert 1215e51edad1. Also, it doesn't seen mrtsock_destruct() takes sk_lock, and the comment to the commit does not show the actual stack dump. So, there is a question did we really need in it. Signed-off-by: Kirill Tkhai --- net

[PATCH net-next v2 3/5] net: Move IP_ROUTER_ALERT out of lock_sock(sk)

2018-03-19 Thread Kirill Tkhai
ip_ra_control() does not need sk_lock. Who are the another users of ip_ra_chain? ip_mroute_setsockopt() doesn't take sk_lock, while parallel IP_ROUTER_ALERT syscalls are synchronized by ip_ra_lock. So, we may move this command out of sk_lock. Signed-off-by: Kirill Tkhai --- net

[PATCH net-next v2 1/5] net: Revert "ipv4: get rid of ip_ra_lock"

2018-03-19 Thread Kirill Tkhai
15e51edad1. ip_ra_lock will be used again. Signed-off-by: Kirill Tkhai --- net/ipv4/ip_sockglue.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 74c962b9b09c..be7c3b71914d 100644 --- a/net/ipv4/ip_sockglue.c +++

[PATCH net-next v2 4/5] net: Make ip_ra_chain per struct net

2018-03-19 Thread Kirill Tkhai
This is optimization, which makes ip_call_ra_chain() iterate less sockets to find the sockets it's looking for. Signed-off-by: Kirill Tkhai --- include/net/ip.h | 13 +++-- include/net/netns/ipv4.h |1 + net/ipv4/ip_input.c |5 ++--- net/ipv4/ip_sockg

[PATCH net-next v2 5/5] net: Replace ip_ra_lock with per-net mutex

2018-03-19 Thread Kirill Tkhai
Since ra_chain is per-net, we may use per-net mutexes to protect them in ip_ra_control(). This improves scalability. Signed-off-by: Kirill Tkhai --- include/net/netns/ipv4.h |1 + net/core/net_namespace.c |1 + net/ipv4/ip_sockglue.c | 15 ++- 3 files changed, 8

Re: [rds-devel] [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)

2018-03-19 Thread Kirill Tkhai
Hi, Sowmini, thanks for looking into this. On 18.03.2018 23:45, Sowmini Varadhan wrote: > On (03/18/18 00:55), Kirill Tkhai wrote: >> >> I just want to make rds not using NETDEV_UNREGISTER_FINAL. If there is >> another solution to do that, I'm not again that. > &g

[PATCH net-next can] Converting pernet_operations (part #9)

2018-03-19 Thread Kirill Tkhai
Hi, this series continues to review and to convert pernet_operations to make them possible to be executed in parallel for several net namespaces at the same time. There is only one patch converting can_pernet_ops. Thanks, Kirill --- Kirill Tkhai (1): net: Convert can_pernet_ops net/can

[PATCH net-next] net: Convert can_pernet_ops

2018-03-19 Thread Kirill Tkhai
/?l=linux-can&m=150169589119335&w=2 So, it looks safe to make them async. Signed-off-by: Kirill Tkhai --- net/can/af_can.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/can/af_can.c b/net/can/af_can.c index 6da324550eec..e899970398a1 100644 --- a/net/can/af_can.c +++ b

[PATCH net-next 0/2] Converting pernet_operations (part #10)

2018-03-19 Thread Kirill Tkhai
ns in inet_evict_bucket()", which is currently in net.git. It seems to be the finial convertion series. Thanks, Kirill --- Kirill Tkhai (2): net: Convert lowpan_frags_ops net: Convert nf_ct_net_ops net/ieee802154/6lowpan/reassembly.c |1 + net/ipv6/netfilter/nf_conntrack_reasm.c |

[PATCH net-next 2/2] net: Convert nf_ct_net_ops

2018-03-19 Thread Kirill Tkhai
These pernet_operations register and unregister sysctl. Also, there is inet_frags_exit_net() called in exit method, which has to be safe after a560002437d3 "net: Fix hlist corruptions in inet_evict_bucket()". Signed-off-by: Kirill Tkhai --- net/ipv6/netfilter/nf_conntrack_reasm.c |

[PATCH net-next 1/2] net: Convert lowpan_frags_ops

2018-03-19 Thread Kirill Tkhai
These pernet_operations register and unregister sysctl. Also, there is inet_frags_exit_net() called in exit method, which has to be safe after a560002437d3 "net: Fix hlist corruptions in inet_evict_bucket()". Signed-off-by: Kirill Tkhai --- net/ieee802154/6lowpan/reassembly.c |1

Re: [PATCH 1/2 v3] net: add uevent socket member

2018-03-19 Thread Kirill Tkhai
Thanks for doing this. One small comment below. On 17.03.2018 14:08, Christian Brauner wrote: > This commit adds struct uevent_sock to struct net. Since struct uevent_sock > records the position of the uevent socket in the uevent socket list we can > trivially remove it from the uevent socket list

Re: [PATCH net-next] rds: tcp: remove register_netdevice_notifier infrastructure.

2018-03-19 Thread Kirill Tkhai
loading only, but this problem is already solved in RDS by rds_destroy_pending() check, which care about that. Reviewed-by: Kirill Tkhai (The only thing I don't know is the reason we need to destroy the sockets before last netdevice, but I haven't dived into that. Just to mention this.

[PATCH net-next] net: Revert net_rwsem

2018-03-30 Thread Kirill Tkhai
't have to take net_rwsem in call_netevent_notifiers(). But since the patchset is not in kernel, let's just revert net_rwsem for now, and I'll resubmit it later (after the above patchset). Signed-off-by: Kirill Tkhai --- drivers/infiniband/core/roce_gid_mgmt.c |2 -- include/linux/rtne

Re: [PATCH net-next] net: Revert net_rwsem

2018-03-30 Thread Kirill Tkhai
On 30.03.2018 12:23, Kirill Tkhai wrote: > This reverts: > > 152f253152cc net: Remove rtnl_lock() in nf_ct_iterate_destroy() > ec9c780925c5 ovs: Remove rtnl_lock() from ovs_exit_net() > 350311aab4c0 security: Remove rtnl_lock() in selinux_xfrm_notify_policyload() > 10256debb9

Re: [PATCH net-next 4/6] inet: frags: use rhashtables for reassembly units

2018-03-30 Thread Kirill Tkhai
Hi, Eric, On 30.03.2018 08:22, Eric Dumazet wrote: > Some applications still rely on IP fragmentation, and to be fair linux > reassembly unit is not working under any serious load. > > It uses static hash tables of 1024 buckets, and up to 128 items per bucket > (!!!) > > A work queue is suppose

Re: [PATCH net-next 0/3] Close race between {un, }register_netdevice_notifier and pernet_operations

2018-03-30 Thread Kirill Tkhai
On 30.03.2018 18:00, David Miller wrote: > From: Kirill Tkhai > Date: Thu, 29 Mar 2018 17:03:15 +0300 > >> the problem is {,un}register_netdevice_notifier() do not take >> pernet_ops_rwsem, and they don't see network namespaces, being >> initialized in setup_n

[PATCH RESEND net-next 0/2] net_rwsem fixes

2018-03-30 Thread Kirill Tkhai
is also fixes the problem of that __rtnl_link_unregister() does not see initializing and exiting nets. Thanks, Kirill --- Kirill Tkhai (2): net: Remove net_rwsem from {,un}register_netdevice_notifier() net: Do not take net_rwsem in __rtnl_link_unregister() drivers/net/dummy.

[PATCH RESEND net-next 2/2] net: Do not take net_rwsem in __rtnl_link_unregister()

2018-03-30 Thread Kirill Tkhai
t. Also, this fixes the problem we had a deal in 328fbe747ad4 "Close race between {un, }register_netdevice_notifier and ...", and guarantees __rtnl_link_unregister() does not skip exitting net. Signed-off-by: Kirill Tkhai --- drivers/net/dummy.c |2 ++ drivers/net/if

[PATCH RESEND net-next 1/2] net: Remove net_rwsem from {, un}register_netdevice_notifier()

2018-03-30 Thread Kirill Tkhai
can't change, so these down_read()/up_read() can be removed. Fixes: f0b07bb151b0 "net: Introduce net_rwsem to protect net_namespace_list" Signed-off-by: Kirill Tkhai --- net/core/dev.c |5 - 1 file changed, 5 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.

Re: [PATCH v2 net-next 08/12] inet: frags: use rhashtables for reassembly units

2018-03-30 Thread Kirill Tkhai
Hi, Eric, thanks for more small patches in v2. One comment below. On 30.03.2018 23:42, Eric Dumazet wrote: > Some applications still rely on IP fragmentation, and to be fair linux > reassembly unit is not working under any serious load. > > It uses static hash tables of 1024 buckets, and up to 1

Re: [BUG/Q] can_pernet_exit() leaves devices on dead net

2018-04-02 Thread Kirill Tkhai
Hi, Oliver, On 02.04.2018 18:28, Oliver Hartkopp wrote: > Hi Kirill, Marc, > > I checked the code once more and added some debug output to the other parts > in CAN notifier code. > > In fact the code pointed to by both of you seems to be obsolete as I only > wanted to be 'really sure' that no

Re: possible deadlock in skb_queue_tail

2018-04-03 Thread Kirill Tkhai
On 02.04.2018 12:20, syzbot wrote: > Hello, > > syzbot hit the following crash on net-next commit > 06b19fe9a6df7aaa423cd8404ebe5ac9ec4b2960 (Sun Apr 1 03:37:33 2018 +) > Merge branch 'chelsio-inline-tls' > syzbot dashboard link: > https://syzkaller.appspot.com/bug?extid=6b495100f17ca8554ab9

Re: possible deadlock in skb_queue_tail

2018-04-03 Thread Kirill Tkhai
On 03.04.2018 14:25, Dmitry Vyukov wrote: > On Tue, Apr 3, 2018 at 11:50 AM, Kirill Tkhai wrote: >> On 02.04.2018 12:20, syzbot wrote: >>> Hello, >>> >>> syzbot hit the following crash on net-next commit >>> 06b19fe9a6df7aaa423cd8404ebe5ac9ec4b2960 (Su

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-05 Thread Kirill Tkhai
On 04.04.2018 22:48, Christian Brauner wrote: > commit 07e98962fa77 ("kobject: Send hotplug events in all network namespaces") > > enabled sending hotplug events into all network namespaces back in 2010. > Over time the set of uevents that get sent into all network namespaces has > shrunk. We have

Re: [PATCH net-next] netns: filter uevents correctly

2018-04-05 Thread Kirill Tkhai
On 05.04.2018 17:07, Christian Brauner wrote: > On Thu, Apr 05, 2018 at 04:01:03PM +0300, Kirill Tkhai wrote: >> On 04.04.2018 22:48, Christian Brauner wrote: >>> commit 07e98962fa77 ("kobject: Send hotplug events in all network >>> namespaces") >>&g

[PATCH RFC iptables] iptables: Per-net ns lock

2018-04-09 Thread Kirill Tkhai
x27;s /run/xtables.lock file, but they may not have permission to open it. Patch makes /run/xtables.lock to be per-namespace, i.e., to refer to the caller task's net ns. What you think? Thanks, Kirill Signed-off-by: Kirill Tkhai --- iptables/xshared.c |7 ++- 1 file changed, 6 i

Re: [lkp-robot] [net] 37b927536f: kernel_BUG_at_net/core/net_namespace.c

2018-02-26 Thread Kirill Tkhai
On 26.02.2018 05:04, kernel test robot wrote: > > FYI, we noticed the following commit (built with gcc-7): > > commit: 37b927536f46b27de240934db9580c3d3eba9937 ("net: Introduce net_sem for > protection of pernet_list") > url: > https://github.com/0day-ci/linux

[PATCH net-next 02/28] net: Convert hashlimit_net_ops and recent_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations just create and destroy /proc entries. Also, new /proc entries also may come after new nf rules are added, but this is not possible, when net isn't alive. So, they are safe to be marked as async. Signed-off-by: Kirill Tkhai --- net/netfilter/xt_hashlimit.c |1 +

[PATCH net-next 00/28] Converting pernet_operations (part #3)

2018-02-26 Thread Kirill Tkhai
, Kirill --- Kirill Tkhai (28): net: Convert /proc creating and destroying pernet_operations net: Convert hashlimit_net_ops and recent_net_ops net: Convert synproxy_net_ops net: Convert nfs_net_ops net: Convert simple pernet_operations net: Convert

[PATCH net-next 01/28] net: Convert /proc creating and destroying pernet_operations

2018-02-26 Thread Kirill Tkhai
These pernet_operations just create and destroy /proc entries, and they can safely marked as async: pppoe_net_ops vlan_net_ops canbcm_pernet_ops kcm_net_ops pfkey_net_ops pppol2tp_net_ops phonet_net_ops Signed-off-by: Kirill Tkhai --- drivers/net/ppp/pppoe.c |1 + net/8021q/vlan.c

[PATCH net-next 03/28] net: Convert synproxy_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations create and destroy /proc entries and allocate extents to template ct, which depend on global nf_ct_ext_types[] array. So, we are able to mark them async. Signed-off-by: Kirill Tkhai --- net/netfilter/nf_synproxy_core.c |1 + 1 file changed, 1 insertion(+) diff --git

[PATCH net-next 04/28] net: Convert nfs_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations just create and destroy /proc entries and net_generic()->cb_ident_idr IDR. So, we are able to mark them async. Signed-off-by: Kirill Tkhai --- fs/nfs/inode.c |1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 7d893543c

[PATCH net-next 05/28] net: Convert simple pernet_operations

2018-02-26 Thread Kirill Tkhai
: Kirill Tkhai --- drivers/net/vrf.c |1 + fs/lockd/svc.c |1 + fs/nfs_common/grace.c |1 + net/ipv6/xfrm6_tunnel.c |1 + net/kcm/kcmsock.c |1 + net/sched/cls_api.c |1 + 6 files changed, 6 insertions(+) diff --git a/drivers/net/vrf.c b/drivers/net

[PATCH net-next 06/28] net: Convert cma_pernet_operations

2018-02-26 Thread Kirill Tkhai
These pernet_operations just create and destroy IDR. So, we mark them as async. Signed-off-by: Kirill Tkhai --- drivers/infiniband/core/cma.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index e66963ca58bd..3ae32d1ddd27

[PATCH net-next 07/28] net: Convert sysctl creating and destroying pernet_operations

2018-02-26 Thread Kirill Tkhai
These pernet_operations create and destroy sysctl tables, and they are able to be executed in parallel with any others: ip_vs_lblc_ops ip_vs_lblcr_ops Signed-off-by: Kirill Tkhai --- net/netfilter/ipvs/ip_vs_lblc.c |1 + net/netfilter/ipvs/ip_vs_lblcr.c |1 + 2 files changed, 2

[PATCH net-next 08/28] net: Convert tc_action_net_init() and tc_action_net_exit() based pernet_operations

2018-02-26 Thread Kirill Tkhai
they can be marked as async. Signed-off-by: Kirill Tkhai --- net/sched/act_bpf.c|1 + net/sched/act_connmark.c |1 + net/sched/act_csum.c |1 + net/sched/act_gact.c |1 + net/sched/act_ife.c|1 + net/sched/act_ipt.c|2 ++ net/sched

[PATCH net-next 09/28] net: Convert bond_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations populate/depopulate /proc and /sys entries. Exit method unregisters all net bond devices, and it seems another pernet_operations are not interested in foreign net bond list. So, it's possible to mark them async. Signed-off-by: Kirill Tkhai --- drivers/net/bo

[PATCH net-next 11/28] net: Convert gtp_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations are similar to bond_net_ops. Exit method unregisters all net gtp devices, and it looks like another pernet_operations are not interested in foreign net gtp list. So, it's possible to mark them async. Signed-off-by: Kirill Tkhai --- drivers/net/gtp.c |1 + 1

[PATCH net-next 10/28] net: Convert geneve_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations are similar to bond_net_ops. Exit method unregisters all net geneve devices, and it looks like another pernet_operations are not interested in foreign net geneve list. So, it's possible to mark them async. Signed-off-by: Kirill Tkhai --- drivers/net/geneve.c |1

[PATCH net-next 12/28] net: Convert ppp_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations are similar to bond_net_ops. Exit method unregisters all net ppp devices, and it looks like another pernet_operations are not interested in foreign net ppp list. So, it's possible to mark them async. Signed-off-by: Kirill Tkhai --- drivers/net/ppp/ppp_generic.c |

[PATCH net-next 14/28] net: Convert br_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations are similar to bond_net_ops. Exit method unregisters all net bridge devices, and it looks like another pernet_operations are not interested in foreign net bridge list. So, it's possible to mark them async. Signed-off-by: Kirill Tkhai --- net/bridge/br.c |1 + 1

[PATCH net-next 13/28] net: Convert vxlan_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations are similar to bond_net_ops. Exit method unregisters all net vlanx devices, and it looks like another pernet_operations are not interested in foreign net vlanx list. So, it's possible to mark them async. Signed-off-by: Kirill Tkhai --- drivers/net/vxlan.c |1

[PATCH net-next 16/28] net: Convert ip6gre_net_ops

2018-02-26 Thread Kirill Tkhai
em async. Signed-off-by: Kirill Tkhai --- net/ipv6/ip6_gre.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 3c353125546d..3026662a6413 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -1517,6 +1517,7 @@ static struct pernet_op

[PATCH net-next 15/28] net: Convert ipgre_net_ops, ipgre_tap_net_ops, erspan_net_ops, vti_net_ops and ipip_net_ops

2018-02-26 Thread Kirill Tkhai
pernet-specific. So, it's possible to mark them async. Signed-off-by: Kirill Tkhai --- net/ipv4/ip_gre.c |3 +++ net/ipv4/ip_vti.c |1 + net/ipv4/ipip.c |1 + 3 files changed, 5 insertions(+) diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 45d97e9b2759..e496afa47709 1

[PATCH net-next 17/28] net: Convert ip6_tnl_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations are similar to ip6gre_net_ops. Exit method unregisters all net ip6_tnl tunnels, and it looks like another pernet_operations are not interested in foreign net tunnels list. So, it's possible to mark them async. Signed-off-by: Kirill Tkhai --- net/ipv6/ip6_tunnel.c |

[PATCH net-next 18/28] net: Convert vti6_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations are similar to ip6_tnl_net_ops. Exit method unregisters all net vti6 tunnels, and it looks like another pernet_operations are not interested in foreign net vti6 list. Init method registers netdevice. So, it's possible to mark them async. Signed-off-by: Kirill

[PATCH net-next 20/28] net: Convert cfg802154_pernet_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations have only exit method, which moves devices from cfg802154_rdev_list to init_net. This may occur in any time from nl802154_wpan_phy_netns(), so we are nice with rtnl_lock() synchronization. Signed-off-by: Kirill Tkhai --- net/ieee802154/core.c |1 + 1 file changed, 1

[PATCH net-next 19/28] net: Convert sit_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations are similar to ip6_tnl_net_ops. Exit method unregisters all net sit devices, and it looks like another pernet_operations are not interested in foreign net sit list. Init method registers netdevice. So, it's possible to mark them async. Signed-off-by: Kirill Tkhai ---

[PATCH net-next 21/28] net: Convert ipvlan_net_ops

2018-02-26 Thread Kirill Tkhai
, all of net code should be well with this behavior. Also at the time of hook unregistering, there are no packets, and foreign net pernet_operations are not interested in others hooks. So, we mark them as async. Signed-off-by: Kirill Tkhai --- drivers/net/ipvlan/ipvlan_main.c |1 + 1 file changed

[PATCH net-next 22/28] net: Convert brnf_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations only unregister nf hooks. So, they are able to be marked as async. Signed-off-by: Kirill Tkhai --- net/bridge/br_netfilter_hooks.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c index 27f1d4f2114a

[PATCH net-next 24/28] net: Convert defrag4_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations only unregister nf hooks. So, they are able to be marked as async. Signed-off-by: Kirill Tkhai --- net/ipv4/netfilter/nf_defrag_ipv4.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/netfilter/nf_defrag_ipv4.c b/net/ipv4/netfilter/nf_defrag_ipv4.c index

[PATCH net-next 23/28] net: Convert clusterip_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations register and unregister nf hooks, and populate and destroy /proc entry. So, they are able to be marked as async. Signed-off-by: Kirill Tkhai --- net/ipv4/netfilter/ipt_CLUSTERIP.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c

[PATCH net-next 25/28] net: Convert ila_net_ops

2018-02-26 Thread Kirill Tkhai
, they are able to be marked as async. Signed-off-by: Kirill Tkhai --- net/ipv6/ila/ila_xlat.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index 44c39c5f0638..e438699f000f 100644 --- a/net/ipv6/ila/ila_xlat.c +++ b/net/ipv6/ila/ila_xlat.c

[PATCH net-next 26/28] net: Convert defrag6_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations only unregister nf hooks. So, they are able to be marked as async. Signed-off-by: Kirill Tkhai --- net/ipv6/netfilter/nf_defrag_ipv6_hooks.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv6/netfilter/nf_defrag_ipv6_hooks.c b/net/ipv6/netfilter

[PATCH net-next 28/28] net: Convert smack_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations only register and unregister nf hooks. So, they are able to be marked as async. Signed-off-by: Kirill Tkhai --- security/smack/smack_netfilter.c |1 + 1 file changed, 1 insertion(+) diff --git a/security/smack/smack_netfilter.c b/security/smack/smack_netfilter.c

[PATCH net-next 27/28] net: Convert selinux_net_ops

2018-02-26 Thread Kirill Tkhai
These pernet_operations only register and unregister nf hooks. So, they are able to be marked as async. Signed-off-by: Kirill Tkhai --- security/selinux/hooks.c |1 + 1 file changed, 1 insertion(+) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 8644d864e3c1

[PATCH net-next 0/2] Converting pernet_operations (part #3) (wireless, mac80211_hwsim)

2018-03-01 Thread Kirill Tkhai
These series fixes ID overflow of hwsim_netgroup [1/2], and reviews and makes hwsim_net_ops as async [2/2]. The first pernet_operations requiring changes to make the converting safe! ([1/2] may be need to [net], but better people see it's really need). Thanks, Kirill --- Kirill Tkh

[PATCH net-next 1/2] mac80211_hwsim: Make hwsim_netgroup IDA

2018-03-01 Thread Kirill Tkhai
as a report to wireless subsystem maintainer, destroy_radio() increaments hwsim_radios_generation without hwsim_radio_lock, so this may need one more patch to fix. Signed-off-by: Kirill Tkhai --- drivers/net/wireless/mac80211_hwsim.c | 14 -- 1 file changed, 8 insertions(+), 6 dele

[PATCH net-next 2/2] net: Convert hwsim_net_ops

2018-03-01 Thread Kirill Tkhai
destroy_radio() work, and these work already may be executed in parallel with any pernet_operations (as it's a work :). So, we may mark these pernet_operations as async. Signed-off-by: Kirill Tkhai --- drivers/net/wireless/mac80211_hwsim.c |1 + 1 file changed, 1 insertion(+) diff --git a/driver

[PATCH net-next] net: Make account struct net to memcg

2018-03-01 Thread Kirill Tkhai
tails. Signed-off-by: Kirill Tkhai --- net/core/net_namespace.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 690e78c6af45..c340d5cfbdec 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -882,7 +

Re: KASAN: use-after-free Read in mac80211_hwsim_del_radio

2018-03-01 Thread Kirill Tkhai
Hi, 01.03.2018, 11:46, "syzbot" : > Hello, > > syzbot hit the following crash on upstream commit > f3afe530d644488a074291da04a69a296ab63046 (Tue Feb 27 22:02:39 2018 +) > Merge branch 'fixes-v4.16-rc4' of > git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security > > So far this c

[BUG/Q] can_pernet_exit() leaves devices on dead net

2018-03-01 Thread Kirill Tkhai
Hi, I'm converting/reviewing pernet_operations either they allow several net namespaces to be created/destroyed in parallel or not. Please, see the details in my recent patches in net-next.git, if your are interested. There is a strange place in can_pernet_ops pernet subsys, I found: static voi

Re: [PATCH net-next 1/2] mac80211_hwsim: Make hwsim_netgroup IDA

2018-03-02 Thread Kirill Tkhai
On 01.03.2018 20:22, Benjamin Beichler wrote: > Am 01.03.2018 um 12:30 schrieb Kirill Tkhai: > >> Out of bounds of this patch, just as a report to wireless subsystem >> maintainer, destroy_radio() increaments hwsim_radios_generation >> without hwsim_radio_lock, so this ma

[PATCH net-next 00/12] Converting pernet_operations (part #4)

2018-03-05 Thread Kirill Tkhai
Hi, this series continues to review and to convert pernet_operations to make them possible to be executed in parallel for several net namespaces in the same time. The patches touch mostly netfilter, also there are small number of changes in other places. Thanks, Kirill --- Kirill Tkhai (12

[PATCH net-next 03/12] net: Convert arp_tables_net_ops and ip6_tables_net_ops

2018-03-05 Thread Kirill Tkhai
These pernet_operations call xt_proto_init() and xt_proto_fini(), which just register and unregister /proc entries. They are safe to be marked as async. Signed-off-by: Kirill Tkhai --- net/ipv4/netfilter/arp_tables.c |1 + net/ipv6/netfilter/ip6_tables.c |1 + 2 files changed, 2

[PATCH net-next 01/12] net: Convert broute_net_ops, frame_filter_net_ops and frame_nat_net_ops

2018-03-05 Thread Kirill Tkhai
are safe to be executed in parallel with any other. Signed-off-by: Kirill Tkhai --- net/bridge/netfilter/ebtable_broute.c |1 + net/bridge/netfilter/ebtable_filter.c |1 + net/bridge/netfilter/ebtable_nat.c|1 + 3 files changed, 3 insertions(+) diff --git a/net/bridge/netfilter

[PATCH net-next 04/12] net: Convert caif_net_ops

2018-03-05 Thread Kirill Tkhai
skb destructor. Since there are no kernel caif sockets nobody can send net a packet in parallel with init/exit, so this is also safe. So, these pernet_operations are safe to be async. Signed-off-by: Kirill Tkhai --- net/caif/caif_dev.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/

[PATCH net-next 05/12] net: Convert cangw_pernet_ops

2018-03-05 Thread Kirill Tkhai
such the messages. So, we mark them as async. Signed-off-by: Kirill Tkhai --- net/can/gw.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/can/gw.c b/net/can/gw.c index 398dd0395ad9..08e97668d5cf 100644 --- a/net/can/gw.c +++ b/net/can/gw.c @@ -1010,6 +1010,7 @@ static void __net_exit

[PATCH net-next 02/12] net: Convert log pernet_operations

2018-03-05 Thread Kirill Tkhai
tered, nobody can send a packet after all netdevices are unregistered. So, these pernet_operations are able to be marked as async. Signed-off-by: Kirill Tkhai --- net/bridge/netfilter/nf_log_bridge.c |1 + net/ipv4/netfilter/nf_log_arp.c |1 + net/ipv4/netfilter/nf_log_ipv4.c |1 +

[PATCH net-next 06/12] net: Convert dccp_v4_ops

2018-03-05 Thread Kirill Tkhai
em as async. Signed-off-by: Kirill Tkhai --- net/dccp/ipv4.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index e65fcb45c3f6..13ad28ab1e79 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -1031,6 +1031,7 @@ static struct pernet_operations dccp_v

[PATCH net-next 10/12] net: Convert nf_conntrack_net_ops

2018-03-05 Thread Kirill Tkhai
These pernet_operations register and unregister sysctl and /proc entries. Exit batch method also waits till all per-net conntracks are dead. Thus, they are safe to be marked as async. Signed-off-by: Kirill Tkhai --- net/netfilter/nf_conntrack_standalone.c |1 + 1 file changed, 1 insertion

[PATCH net-next 12/12] net: Convert proto_gre_net_ops

2018-03-05 Thread Kirill Tkhai
These pernet_operations register and unregister sysctl. nf_conntrack_l4proto_gre4->init_net is simple memory initializer. Also, exit method removes gre keymap_list, which is per-net. This looks safe to be executed in parallel with other pernet_operations. Signed-off-by: Kirill Tkhai ---

[PATCH net-next 11/12] net: Convert ctnetlink_net_ops

2018-03-05 Thread Kirill Tkhai
forgotten. But there is synchronize_rcu() on module exit patch (in ctnetlink_exit()), so this batch may be reworked as simple .exit method. Signed-off-by: Kirill Tkhai --- net/netfilter/nf_conntrack_netlink.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/nf_conntrack_netlink.c b

[PATCH net-next 09/12] net: Convert ip_set_net_ops

2018-03-05 Thread Kirill Tkhai
#else static inline func(void); #endif So, there are no more pernet operations, dereferencing net_generic(net, ip_set_net_id). ip_set_net_ops are OK to be executed in parallel for several net, so we mark them as async. Signed-off-by: Kirill Tkhai --- net/netfilter/ipset/ip_

[PATCH net-next 07/12] net: Convert dccp_v6_ops

2018-03-05 Thread Kirill Tkhai
These pernet_operations looks similar to dccp_v4_ops, and they are also safe to be marked as async. Signed-off-by: Kirill Tkhai --- net/dccp/ipv6.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 5df7857fc0f3..2f48c020f8c3 100644 --- a/net/dccp

[PATCH net-next 08/12] net: Convert fou_net_ops

2018-03-05 Thread Kirill Tkhai
. Signed-off-by: Kirill Tkhai --- net/ipv4/fou.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c index 1540db65241a..d3e1a9af478b 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c @@ -1081,6 +1081,7 @@ static struct pernet_operations fou_net_ops

Re: [BUG/Q] can_pernet_exit() leaves devices on dead net

2018-03-05 Thread Kirill Tkhai
Hi, Oliver, thanks for your reply. On 05.03.2018 16:59, Oliver Hartkopp wrote: > Hi Kirill, > > On 03/01/2018 04:53 PM, Kirill Tkhai wrote: > >> I'm converting/reviewing pernet_operations either they allow several net >> namespaces >> to be created/destro

[PATCH net] net: Fix hlist corruptions in inet_evict_bucket()

2018-03-06 Thread Kirill Tkhai
to stable. Fixes: d1fe19444d82 "inet: frag: don't re-use chainlist for evictor" Fixes: f84c6821aa54 "net: Convert pernet_subsys, registered from inet_init()" Signed-off-by: Kirill Tkhai --- net/ipv4/inet_fragment.c |3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH RESEND net-next] net: Do synchronize_rcu() in ip6mr_sk_done() only if this is needed

2018-03-06 Thread Kirill Tkhai
ed it. So, the progress of kworker becomes very slow. The patch introduces apparent solution, and it makes ip6mr_sk_done() to skip synchronize_rcu() for sockets, that are not need that. After the patch, kworker becomes able to warm the cpu up as expected. Signed-off-by: Kirill Tkhai --- net/ipv

Re: [PATCH RESEND net-next] net: Do synchronize_rcu() in ip6mr_sk_done() only if this is needed

2018-03-07 Thread Kirill Tkhai
On 06.03.2018 19:50, Eric Dumazet wrote: > On Tue, 2018-03-06 at 19:24 +0300, Kirill Tkhai wrote: >> After unshare test kworker hangs for ages: >> >> $ while :; do unshare -n true; done & >> >> $ perf report >> -   88,82% 0,00%  kworker/

Re: [PATCH RESEND net-next] net: Do synchronize_rcu() in ip6mr_sk_done() only if this is needed

2018-03-07 Thread Kirill Tkhai
On 07.03.2018 12:22, Kirill Tkhai wrote: > On 06.03.2018 19:50, Eric Dumazet wrote: >> On Tue, 2018-03-06 at 19:24 +0300, Kirill Tkhai wrote: >>> After unshare test kworker hangs for ages: >>> >>> $ while :; do unshare -n true; done & >>> &

[PATCH net-next 00/16] Converting pernet_operations (part #5)

2018-03-07 Thread Kirill Tkhai
xfrm. Thanks, Kirill --- Kirill Tkhai (16): net: Convert ip6 tables pernet_operations net: Convert xfrm_user_net_ops net: Convert nf_tables_net_ops net: Convert nfnetlink_net_ops net: Convert nfnl_acct_ops net: Convert cttimeout_ops net: Convert nfnl_log_ne

[PATCH net-next 01/16] net: Convert ip6 tables pernet_operations

2018-03-07 Thread Kirill Tkhai
must not be in-flight ipv6 packets at the time of pernet_operations execution and since pernet_operations don't send ipv6 packets each other, these pernet_operations are safe to be async. Signed-off-by: Kirill Tkhai --- net/ipv6/netfilter/ip6table_filter.c |1 + net/ipv6/netf

[PATCH net-next 03/16] net: Convert nf_tables_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations looks nicely separated per-net. Exit method unregisters net's nf tables objects. We allow them be executed in parallel. Signed-off-by: Kirill Tkhai --- net/netfilter/nf_tables_api.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/nf_tables_ap

[PATCH net-next 05/16] net: Convert nfnl_acct_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations look closed in themself, and there are no other users of net::nfnl_acct_list outside. They are safe to be executed for several net namespaces in parallel. Signed-off-by: Kirill Tkhai --- net/netfilter/nfnetlink_acct.c |1 + 1 file changed, 1 insertion(+) diff --git

[PATCH net-next 04/16] net: Convert nfnetlink_net_ops

2018-03-07 Thread Kirill Tkhai
it async. Signed-off-by: Kirill Tkhai --- net/netfilter/nfnetlink.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 03ead8a9e90c..84fc4954862d 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c @@ -566,6 +566,7

[PATCH net-next 02/16] net: Convert xfrm_user_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations create and destroy net::xfrm::nlsk socket of NETLINK_XFRM. There is only entry point, where it's dereferenced, it's xfrm_user_rcv_msg(). There is no in-kernel senders to this socket. Signed-off-by: Kirill Tkhai --- net/xfrm/xfrm_user.c |1 + 1 file

[PATCH net-next 07/16] net: Convert nfnl_log_net_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations create and destroy /proc entries. Also, exit method unsets nfulnl_logger. The logger is not set by default, and it becomes bound via userspace request. So, they look safe to be made async. Signed-off-by: Kirill Tkhai --- net/netfilter/nfnetlink_log.c |1 + 1 file

[PATCH net-next 06/16] net: Convert cttimeout_ops

2018-03-07 Thread Kirill Tkhai
These pernet_operations also look closed in themself. Exit method touch only per-net structures, so it's safe to execute them for several net namespaces in parallel. Signed-off-by: Kirill Tkhai --- net/netfilter/nfnetlink_cttimeout.c |1 + 1 file changed, 1 insertion(+) diff --git

<    1   2   3   4   5   >