Re: [PATCH v4 02/27] net: datagram: fix some kernel-doc markups

2020-11-16 Thread Kirill Tkhai
On 16.11.2020 13:17, Mauro Carvalho Chehab wrote: > Some identifiers have different names between their prototypes > and the kernel-doc markup. > > Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Kirill Tkhai > --- > net/core/datagram.c | 2 +- > net/core/dev.c

[PATCH 1/2] tun: Add ioctl() TUNGETDEVNETNS cmd to allow obtaining real net ns of tun device

2019-03-20 Thread Kirill Tkhai
net ns of device. We may have two tun devices with the same names in two net ns, and in this case it's not possible to determ, which of them fd refers to (TUNGETIFF will return the same name). This patch adds new ioctl() cmd for obtaining net ns of a device. Reported-by: Harald Albrecht Signed

[PATCH 2/2] tun: Remove unused first parameter of tun_get_iff()

2019-03-20 Thread Kirill Tkhai
Signed-off-by: Kirill Tkhai --- drivers/net/tun.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index b7137edff624..b834b0d168f9 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2873,8 +2873,7 @@ static int

Re: [PATCH] net: check negative value for signed refcnt

2019-01-31 Thread Kirill Tkhai
On 31.01.2019 18:21, Eric Dumazet wrote: > > > On 01/31/2019 07:15 AM, Eric Dumazet wrote: >> >> >> On 01/31/2019 05:49 AM, Kirill Tkhai wrote: >>> >>> 2)Not related to your patch -- it looks like we have problem in existing >>> code with

Re: [PATCH] net: check negative value for signed refcnt

2019-01-31 Thread Kirill Tkhai
On 31.01.2019 18:14, Alexandre BESNARD wrote: > Hi Kirill, and thanks for your time, > > On 31 Jan 19 14:49, Kirill Tkhai ktk...@virtuozzo.com wrote : > >> Hi, Alexandre, > >> On 31.01.2019 16:20, alexandre.besn...@softathome.com wrote: >>> From: Alexan

Re: [PATCH] net: check negative value for signed refcnt

2019-01-31 Thread Kirill Tkhai
Hi, Alexandre, On 31.01.2019 16:20, alexandre.besn...@softathome.com wrote: > From: Alexandre Besnard > > Device remaining references counter is get as a signed integer. > > When unregistering network devices, the loop waiting for this counter > to decrement tests the 0 strict equality. Thus if

Re: net/core: BUG in copy_net_ns()

2019-01-11 Thread Kirill Tkhai
On 11.01.2019 23:33, Eric W. Biederman wrote: > zzoru writes: > >> net/core: BUG in copy_net_ns() (net_namespace.c) > > I don't understand this failure report at all. > > I don't see the connection to copy_net_ns(). And I don't see how the > suggested patch short of covering up a memory stomp

Re: [PATCH] ipset: fix a missing check of nla_parse

2019-01-10 Thread Kirill Tkhai
On 10.01.2019 01:43, Pablo Neira Ayuso wrote: > On Wed, Dec 26, 2018 at 12:16:25PM +0300, Kirill Tkhai wrote: >> On 26.12.2018 06:50, Kangjie Lu wrote: >>> When nla_parse fails, we should not use the results (the first >>> argument). The fix checks if it fails, and if

Re: [PATCH] net: core: Fix to store new mtu setting in netdevice.

2018-12-31 Thread Kirill Tkhai
On 01.01.2019 09:42, Murali Krishna Policharla wrote: > Store newly configured mtu settings in the netdevice after mtu > configuration is successful to the dsa switch. > > Fixes: 2315dc91a5 ("net: make dev_set_mtu() honor notification return code") > Signed-off-by: Murali Krishna Policharla > Rev

Re: [PATCH] ipset: fix a missing check of nla_parse

2018-12-26 Thread Kirill Tkhai
On 26.12.2018 06:50, Kangjie Lu wrote: > When nla_parse fails, we should not use the results (the first > argument). The fix checks if it fails, and if so, returns its error code > upstream. > > Signed-off-by: Kangjie Lu > --- > net/netfilter/ipset/ip_set_core.c | 4 +++- > 1 file changed, 3 ins

Re: [PATCH] net/net_namespace: Check the return value of register_pernet_subsys()

2018-12-24 Thread Kirill Tkhai
On 24.12.2018 04:42, Aditya Pakki wrote: > In net_ns_init(), register_pernet_subsys() could fail while registering > network namespace subsystems. The fix checks the return value and > sends a panic() on failure. > > Signed-off-by: Aditya Pakki Reviewed-by: Kirill Tkhai &g

[PATCH net-next 0/3] Refactorings on af_inet pernet initialization

2018-09-20 Thread Kirill Tkhai
This patch set makes several cleanups around inet_init_net(). --- Cong Wang (1): ipv4: initialize ra_mutex in inet_init_net() Kirill Tkhai (2): net: Remove inet_exit_net() net: Register af_inet_ops earlier net/core/net_namespace.c |1 - net/ipv4/af_inet.c | 13

[PATCH 2/3] net: Register af_inet_ops earlier

2018-09-20 Thread Kirill Tkhai
This function just initializes locks and defaults. Let register it before other pernet operation, since some of them potentially may relay on that. Signed-off-by: Kirill Tkhai --- net/ipv4/af_inet.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/ipv4/af_inet.c

[PATCH 3/3] ipv4: initialize ra_mutex in inet_init_net()

2018-09-20 Thread Kirill Tkhai
f-by: Cong Wang Acked-by: Kirill Tkhai --- net/core/net_namespace.c |1 - net/ipv4/af_inet.c |2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 670c84b1bfc2..b272ccfcbf63 100644 --- a/net/core/net_namespace.c

[PATCH 1/3] net: Remove inet_exit_net()

2018-09-20 Thread Kirill Tkhai
This function does nothing, and since ops_exit_list() checks for NULL ->exit method, we do not need stub here. Signed-off-by: Kirill Tkhai --- net/ipv4/af_inet.c |5 - 1 file changed, 5 deletions(-) diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 1fbe2f815474..f4ecbe0aa

Re: [Patch net-next] ipv4: initialize ra_mutex in inet_init_net()

2018-09-20 Thread Kirill Tkhai
On 20.09.2018 0:28, Cong Wang wrote: > On Wed, Sep 19, 2018 at 1:25 AM Kirill Tkhai wrote: >> >> On 18.09.2018 23:17, Cong Wang wrote: >>> On Mon, Sep 17, 2018 at 12:25 AM Kirill Tkhai wrote: >>>> In inet_init() the order of registrat

Re: [Patch net-next] ipv4: initialize ra_mutex in inet_init_net()

2018-09-19 Thread Kirill Tkhai
On 18.09.2018 23:17, Cong Wang wrote: > On Mon, Sep 17, 2018 at 12:25 AM Kirill Tkhai wrote: >> In inet_init() the order of registration is: >> >> ip_mr_init(); >> init_inet_pernet_ops(); >> >> This means, ipmr_net_ops pernet operations are b

Re: [Patch net-next] ipv4: initialize ra_mutex in inet_init_net()

2018-09-17 Thread Kirill Tkhai
ace ip_ra_lock with per-net mutex") > Cc: Kirill Tkhai > Signed-off-by: Cong Wang > --- > net/core/net_namespace.c | 1 - > net/ipv4/af_inet.c | 2 ++ > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/core/net_namespace.c b/net/core/net_n

Re: [PATCH net-next 03/13] net: sched: extend Qdisc with rcu

2018-09-06 Thread Kirill Tkhai
On 06.09.2018 11:30, Eric Dumazet wrote: > > > On 09/06/2018 12:58 AM, Vlad Buslov wrote: > > ... > >> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h >> index 18e22a5a6550..239c73f29471 100644 >> --- a/include/net/sch_generic.h >> +++ b/include/net/sch_generic.h >> @@ -90,6

Re: [PATCH] net: Fix device name resolving crash in default_device_exit()

2018-06-22 Thread Kirill Tkhai
On 21.06.2018 18:28, David Ahern wrote: > On 6/21/18 4:03 AM, Kirill Tkhai wrote: >>> This patch does not remove the BUG, so does not really solve the >>> problem. ie., it is fairly trivial to write a script (32k dev%d named >>> devices in init_net) that triggers it

Re: [PATCH] net: Fix device name resolving crash in default_device_exit()

2018-06-21 Thread Kirill Tkhai
On 20.06.2018 20:15, David Ahern wrote: > On 6/20/18 2:57 AM, Kirill Tkhai wrote: >> From: Kirill Tkhai >> >> The following script makes kernel to crash since it can't obtain >> a name for a device, when the name is occupied by another device: >> >> #

[PATCH] net: Fix device name resolving crash in default_device_exit()

2018-06-20 Thread Kirill Tkhai
From: Kirill Tkhai The following script makes kernel to crash since it can't obtain a name for a device, when the name is occupied by another device: #!/bin/bash ifconfig eth0 down ifconfig eth1 down index=`cat /sys/class/net/eth1/ifindex` ip link set eth1 name dev$index unshare -n sle

Re: [PATCH] net: Fix device name resolving crash in default_device_exit()

2018-06-18 Thread Kirill Tkhai
On 18.06.2018 14:21, Kirill Tkhai wrote: > On 17.06.2018 21:58, David Ahern wrote: >> On 6/15/18 3:44 AM, Kirill Tkhai wrote: >>> Hm, but is this a likely case, when real device is moved to net ns, so it >>> requires moving to init_net back? It seems the most devi

Re: [PATCH] net: Fix device name resolving crash in default_device_exit()

2018-06-18 Thread Kirill Tkhai
On 17.06.2018 21:58, David Ahern wrote: > On 6/15/18 3:44 AM, Kirill Tkhai wrote: >> Hm, but is this a likely case, when real device is moved to net ns, so it >> requires moving to init_net back? It seems the most devices moved to >> !init_net >> are virtual

Re: [PATCH] net: Fix device name resolving crash in default_device_exit()

2018-06-15 Thread Kirill Tkhai
On 14.06.2018 20:11, David Ahern wrote: > On 6/14/18 6:38 AM, Kirill Tkhai wrote: >> The following script makes kernel to crash since it can't obtain >> a name for a device, when the name is occupied by another device: >> >> #!/bin/bash >> ifconfig eth0 do

[PATCH] net: Fix device name resolving crash in default_device_exit()

2018-06-14 Thread Kirill Tkhai
ck trace snipped] This patch gives more variability during choosing new name of device and fixes the problem. Signed-off-by: Kirill Tkhai --- net/core/dev.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index 6e18242a1cae..6c9b9303ded6 1006

Re: [PATCH net] kcm: fix races on sk_receive_queue

2018-06-06 Thread Kirill Tkhai
On 06.06.2018 16:16, Paolo Abeni wrote: > KCM removes the packets from sk_receive_queue in requeue_rx_msgs() > > without acquiring any lock. Moreover, in R() when the MSG_PEEK > flag is not present, the skb is peeked and dequeued with two > separate, non-atomic, calls. > > The above create room f

Re: [RFC PATCH] kcm: hold rx mux lock when updating the receive queue.

2018-06-06 Thread Kirill Tkhai
Hi, Paolo, below is couple my thoughts about this. On 06.06.2018 12:44, Paolo Abeni wrote: > On Tue, 2018-06-05 at 18:06 +0200, Paolo Abeni wrote: >> On Tue, 2018-06-05 at 08:35 -0700, Tom Herbert wrote: >>> Paolo, thanks for looking into this! Can you try replacing >>> __skb_dequeue in requeue_r

Re: Dead lock condition occured ipanic during register_netdevice_notifier call in 4.9.102

2018-05-31 Thread Kirill Tkhai
Hi, Illyas, On 31.05.2018 11:43, Mansoor, Illyas wrote: > We are facing mutex dead lock condition that we think might be related to a > fix that you have provided in: > Merge branch > 'Close-race-between-un-register_netdevice_notifier-and-pernet_operations' > commit b9a12601541eb55d07e00261a511

Re: Expected result when racing listen(2) on two sockets bound to the same address

2018-05-23 Thread Kirill Tkhai
Hi, On 23.05.2018 14:15, Alexander Kurtz wrote: > [Please keep me CC'ed; I'm not subscribed to the list] > > Hi! > > The program shown below (also available at [0]) does the following: > > * Create two sockets > * Enable SO_REUSEADDR on both > * Bind both sockets to [::1]:12345 > * Spawn tw

Re: [PATCH net-next] tun: Do SIOCGSKNS out of rtnl_lock()

2018-05-09 Thread Kirill Tkhai
Hi, Jason, On 09.05.2018 10:18, Jason Wang wrote: > > > On 2018年05月09日 00:21, Kirill Tkhai wrote: >> Since net ns of tun device is assigned on the device creation, >> and it never changes, we do not need to use any lock to get it >> from alive tun. >&g

[PATCH net-next] tun: Do SIOCGSKNS out of rtnl_lock()

2018-05-08 Thread Kirill Tkhai
Since net ns of tun device is assigned on the device creation, and it never changes, we do not need to use any lock to get it from alive tun. Signed-off-by: Kirill Tkhai --- drivers/net/tun.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/net

[PATCH net-next] net: Fix coccinelle warning

2018-04-26 Thread Kirill Tkhai
kbuild test robot says: >coccinelle warnings: (new ones prefixed by >>) >>> net/core/dev.c:1588:2-3: Unneeded semicolon So, let's remove it. Reported-by: kbuild test robot Signed-off-by: Kirill Tkhai --- net/core/dev.c |2 +- 1 file changed, 1 insertion(+), 1

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

2018-04-23 Thread Kirill Tkhai
On 21.04.2018 02:06, Andrei Vagin wrote: > On Fri, Apr 20, 2018 at 04:42:47PM +0300, Kirill Tkhai wrote: >> Containers want to restore their own net ns, >> while they may have no their own mnt ns. >> This case they share host's /run/xtables.lock >> file, but they

[PATCH] iptables: Per-net ns lock

2018-04-20 Thread Kirill Tkhai
ned-off-by: Kirill Tkhai --- iptables/xshared.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iptables/xshared.c b/iptables/xshared.c index 06db72d4..b6dbe4e7 100644 --- a/iptables/xshared.c +++ b/iptables/xshared.c @@ -254,7 +254,12 @@ static int xtables_lock(int wa

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

2018-04-20 Thread Kirill Tkhai
Hi, Florian, On 20.04.2018 13:50, Florian Westphal wrote: > Kirill Tkhai wrote: >> Pablo, Florian, could you please provide comments on this? >> >> On 09.04.2018 19:55, Kirill Tkhai wrote: >>> In CRIU and LXC-restore we met the situation, >>> when

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

2018-04-20 Thread Kirill Tkhai
Pablo, Florian, could you please provide comments on this? On 09.04.2018 19:55, Kirill Tkhai wrote: > In CRIU and LXC-restore we met the situation, > when iptables in container can't be restored > because of permission denied: > > https://github.com/checkpoint-res

Re: [bisected] Stack overflow after fs: "switch the IO-triggering parts of umount to fs_pin" (was net namespaces kernel stack overflow)

2018-04-19 Thread Kirill Tkhai
ng the lines of the following: > > Don't leak MNT_INTERNAL away from internal mounts > > We want it only for the stuff created by SB_KERNMOUNT mounts, *not* for > their copies. > > Cc: sta...@kernel.org > Signed-off-by: Al Viro Flawless victory! Thanks. Tested-b

[bisected] Stack overflow after fs: "switch the IO-triggering parts of umount to fs_pin" (was net namespaces kernel stack overflow)

2018-04-19 Thread Kirill Tkhai
[ 22.183065] [] exit_task_namespaces+0xb/0x10 [ 22.183065] [] do_exit+0x2c7/0xc00 [ 22.183065] [] do_group_exit+0x3a/0xa0 [ 22.183065] [] SyS_exit_group+0xf/0x10 [ 22.183065] [] system_call_fastpath+0x12/0x17 Kirill On 19.04.2018 01:08, Kirill Tkhai wrote: > Hi, Alexander! >

Re: net namespaces kernel stack overflow

2018-04-18 Thread Kirill Tkhai
Hi, Alexander! On 18.04.2018 22:45, Alexander Aring wrote: > I currently can crash my net/master kernel by execute the following script: > > --- snip > > modprobe dummy > > #mkdir /var/run/netns > #touch /var/run/netns/init_net > #mount --bind /proc/1/ns/net /var/run/netns/init_net > > while t

[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: [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

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: 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: 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: [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: [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

[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.

[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 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.

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

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] 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

[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

[PATCH net-next 5/5] net: Remove rtnl_lock() in nf_ct_iterate_destroy()

2018-03-29 Thread Kirill Tkhai
rtnl_lock() doesn't protect net::ct::count, and it's not needed for__nf_ct_unconfirmed_destroy() and for nf_queue_nf_hook_drop(). Signed-off-by: Kirill Tkhai --- net/netfilter/nf_conntrack_core.c |2 -- 1 file changed, 2 deletions(-) diff --git a/net/netfilter/nf_conntrack_cor

[PATCH net-next 2/5] net: Don't take rtnl_lock() in wireless_nlevent_flush()

2018-03-29 Thread Kirill Tkhai
that can change the order, but since skb can be queued in any order, it doesn't matter, how many threads do this in parallel. In case of several threads, this will be even faster. So, we can remove rtnl_lock() here, as it was used for iteration over net_namespace_list only. Signed-off-by: Ki

[PATCH net-next 3/5] security: Remove rtnl_lock() in selinux_xfrm_notify_policyload()

2018-03-29 Thread Kirill Tkhai
to iterate net_namespace_list only, and we can remove it. Signed-off-by: Kirill Tkhai --- security/selinux/include/xfrm.h |2 -- 1 file changed, 2 deletions(-) diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h index 31d66431be1e..a0b465316292 100644 --- a/securi

[PATCH net-next 4/5] ovs: Remove rtnl_lock() from ovs_exit_net()

2018-03-29 Thread Kirill Tkhai
Here we iterate for_each_net() and removes vport from alive net to the exiting net. ovs_net::dps are protected by ovs_mutex(), and the others, who change it (ovs_dp_cmd_new(), __dp_destroy()) also take it. The same with datapath::ports list. So, we remove rtnl_lock() here. Signed-off-by: Kirill

[PATCH net-next 1/5] net: Introduce net_rwsem to protect net_namespace_list

2018-03-29 Thread Kirill Tkhai
emove rtnl_lock() there are in next patches. Fine grained locks generally are better, then one big lock, so let's do that with net_namespace_list, while the situation allows that. Signed-off-by: Kirill Tkhai --- drivers/infiniband/core/roce_gid_mgmt.c |2 ++ include/linux/rtnetlink.h

[PATCH net-next 0/5] Introduce net_rwsem to protect net_namespace_list

2018-03-29 Thread Kirill Tkhai
people, and I add all to CC. Note, that this patch is independent of "Close race between {un, }register_netdevice_notifier and pernet_operations": https://patchwork.ozlabs.org/project/netdev/list/?series=36495 Signed-off-by: Kirill Tkhai --- Kirill Tkhai (5): net: Introduce ne

[PATCH net-next 3/3] net: Close race between {un, }register_netdevice_notifier() and setup_net()/cleanup_net()

2018-03-29 Thread Kirill Tkhai
does not show, someone creates such sockets from kernel space. Theoretically, there can be more places like this, and which are hidden from review, but we found them on the first bumping there (since there is no a race, it will be 100% reproducible). Signed-off-by: Kirill Tkhai --- net/core/dev.c

[PATCH net-next 2/3] netfilter: Rework xt_TEE netdevice notifier

2018-03-29 Thread Kirill Tkhai
. Tested via: while :; do unshare -n iptables -t mangle -A OUTPUT -j TEE --gateway 1.1.1.2 --oif lo; done Signed-off-by: Kirill Tkhai --- net/netfilter/xt_TEE.c | 73 ++-- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/net

[PATCH net-next 1/3] xfrm: Register xfrm_dev_notifier in appropriate place

2018-03-29 Thread Kirill Tkhai
igned-off-by: Kirill Tkhai --- include/net/xfrm.h |2 +- net/xfrm/xfrm_device.c |2 +- net/xfrm/xfrm_policy.c |3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index aa027ba1d032..a872379b69da 100644 --- a/include/net/x

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

2018-03-29 Thread Kirill Tkhai
ich register or unregister netdevice notifiers, and that leads to deadlock (which is was fixed in 1-2/3). This patchset is for net-next. Thanks, Kirill --- Kirill Tkhai (3): xfrm: Register xfrm_dev_notifier in appropriate place netfilter: Rework xt_TEE netdevice notifier net: Clo

Re: [PATCH V5 net-next 06/14] net/tls: Add generic NIC offload infrastructure

2018-03-28 Thread Kirill Tkhai
On 28.03.2018 02:56, Saeed Mahameed wrote: > From: Ilya Lesokhin > > This patch adds a generic infrastructure to offload TLS crypto to a > network device. It enables the kernel TLS socket to skip encryption > and authentication operations on the transmit side of the data path. > Leaving those com

Re: [PATCH net-next 0/5] Make pernet_operations always read locked

2018-03-27 Thread Kirill Tkhai
On 27.03.2018 20:18, David Miller wrote: > From: Kirill Tkhai > Date: Tue, 27 Mar 2018 18:01:42 +0300 > >> All the pernet_operations are converted, and the last one >> is in this patchset (nfsd_net_ops acked by J. Bruce Fields). >> So, it's the time to kill pernet

[PATCH net-next 5/5] net: Add more comments

2018-03-27 Thread Kirill Tkhai
This adds comments to different places to improve readability. Signed-off-by: Kirill Tkhai --- include/net/net_namespace.h |4 net/core/net_namespace.c|2 ++ net/core/rtnetlink.c|2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/net

[PATCH net-next 4/5] net: Rename net_sem to pernet_ops_rwsem

2018-03-27 Thread Kirill Tkhai
net_sem is some undefined area name, so it will be better to make the area more defined. Rename it to pernet_ops_rwsem for better readability and better intelligibility. Signed-off-by: Kirill Tkhai --- include/linux/rtnetlink.h |2 +- include/net/net_namespace.h | 12 +++- net

[PATCH net-next 3/5] net: Drop pernet_operations::async

2018-03-27 Thread Kirill Tkhai
Synchronous pernet_operations are not allowed anymore. All are asynchronous. So, drop the structure member. Signed-off-by: Kirill Tkhai --- drivers/infiniband/core/cma.c |1 - drivers/net/bonding/bond_main.c|1 - drivers/net/geneve.c

[PATCH net-next 2/5] net: Reflect all pernet_operations are converted

2018-03-27 Thread Kirill Tkhai
All pernet_operations are reviewed and converted, hooray! Reflect this in core code: setup_net() and cleanup_net() will take down_read() always. Signed-off-by: Kirill Tkhai --- net/core/net_namespace.c | 43 ++- 1 file changed, 6 insertions(+), 37

[PATCH net-next 1/5] net: Convert nfsd_net_ops

2018-03-27 Thread Kirill Tkhai
These pernet_operations look similar to rpcsec_gss_net_ops, they just create and destroy another caches. So, they also can be async. Signed-off-by: Kirill Tkhai Acked-by: J. Bruce Fields --- fs/nfsd/nfsctl.c |1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd

[PATCH net-next 0/5] Make pernet_operations always read locked

2018-03-27 Thread Kirill Tkhai
ve to be developed to fit this rule. Some of previous patches added a comment to struct pernet_operations about that. Also, this patchset renames net_sem to pernet_ops_rwsem to make the target area of the rwsem is more clear visible, and adds more comments. Thanks, Kirill --- Kirill Tkh

Re: [PATCH net-next] net: Export net->ipv6.sysctl.ip_nonlocal_bind to /proc

2018-03-27 Thread Kirill Tkhai
Please, ignore this. Thanks, Kirill On 27.03.2018 14:24, Kirill Tkhai wrote: > Currenly, this parameter can be configured via sysctl > only. But sysctl is considered as depricated interface > (man 2 sysctl), and it only can applied to current's net > namespace (this requires

[PATCH net-next] net: Export net->ipv6.sysctl.ip_nonlocal_bind to /proc

2018-03-27 Thread Kirill Tkhai
roc in standard way, and this allows to access another process namespace via /proc/[pid]/net/ip6_nonlocal_bind. Signed-off-by: Kirill Tkhai --- net/ipv6/proc.c | 48 1 file changed, 48 insertions(+) diff --git a/net/ipv6/proc.c b/net/ip

Re: [PATCH net-next nfs 1/6] net: Convert rpcsec_gss_net_ops

2018-03-27 Thread Kirill Tkhai
On 26.03.2018 21:36, J. Bruce Fields wrote: > On Fri, Mar 23, 2018 at 02:53:34PM -0400, Anna Schumaker wrote: >> >> >> On 03/13/2018 06:49 AM, Kirill Tkhai wrote: >>> These pernet_operations initialize and destroy sunrpc_net_id refered >>> per-net items. O

Re: [PATCH net-next nfs 1/6] net: Convert rpcsec_gss_net_ops

2018-03-26 Thread Kirill Tkhai
On 23.03.2018 21:53, Anna Schumaker wrote: > > > On 03/13/2018 06:49 AM, Kirill Tkhai wrote: >> These pernet_operations initialize and destroy sunrpc_net_id >> refered per-net items. Only used global list is cache_list, >> and accesses already serialized. >&g

[PATCH net-next v1 3/4] net: Convert nfs4_dns_resolver_ops

2018-03-26 Thread Kirill Tkhai
These pernet_operations look similar to rpcsec_gss_net_ops, they just create and destroy another cache. Also they create and destroy directory. So, they also look safe to be async. Signed-off-by: Kirill Tkhai Acked-by: Anna Schumaker --- fs/nfs/dns_resolve.c |1 + 1 file changed, 1

[PATCH net-next v1 4/4] net: Convert nfs4blocklayout_net_ops

2018-03-26 Thread Kirill Tkhai
These pernet_operations create and destroy per-net pipe and dentry, and they seem safe to be marked as async. Signed-off-by: Kirill Tkhai Acked-by: Anna Schumaker --- fs/nfs/blocklayout/rpc_pipefs.c |1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/blocklayout/rpc_pipefs.c b/fs/nfs

[PATCH net-next v1 2/4] net: Convert sunrpc_net_ops

2018-03-26 Thread Kirill Tkhai
These pernet_operations look similar to rpcsec_gss_net_ops, they just create and destroy another caches. So, they also can be async. Signed-off-by: Kirill Tkhai Acked-by: Anna Schumaker --- net/sunrpc/sunrpc_syms.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/sunrpc_syms.c

[PATCH net-next v1 0/4] Converting pernet_operations (part #7.1)

2018-03-26 Thread Kirill Tkhai
net/sunrpc/sunrpc_syms.c|1 + 4 files changed, 4 insertions(+) -- Signed-off-by: Kirill Tkhai Acked-by: Anna Schumaker

[PATCH net-next v1 1/4] net: Convert rpcsec_gss_net_ops

2018-03-26 Thread Kirill Tkhai
can't be callers in parallel, so we won't miss list_empty() in this case. Signed-off-by: Kirill Tkhai Acked-by: Anna Schumaker --- net/sunrpc/auth_gss/auth_gss.c |1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c ind

[PATCH net-next v2 2/3] infiniband: Replace usnic_ib_netdev_event_to_string() with netdev_cmd_to_name()

2018-03-23 Thread Kirill Tkhai
This function just calls netdev_cmd_to_name(). Signed-off-by: Kirill Tkhai --- drivers/infiniband/hw/usnic/usnic_ib_main.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/infiniband/hw/usnic/usnic_ib_main.c b/drivers/infiniband/hw/usnic

[PATCH net-next v2 3/3] net: Drop NETDEV_UNREGISTER_FINAL

2018-03-23 Thread Kirill Tkhai
ned-off-by: Kirill Tkhai --- drivers/infiniband/hw/qedr/main.c |4 ++-- include/linux/netdevice.h |1 - include/rdma/ib_verbs.h |4 ++-- net/core/dev.c|7 --- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/infiniband/hw/q

[PATCH net-next v2 0/3] Drop NETDEV_UNREGISTER_FINAL (was unnamed)

2018-03-23 Thread Kirill Tkhai
nice, if you fill OK to tag v2 too. Thanks, Kirill --- Kirill Tkhai (3): net: Make NETDEV_XXX commands enum { } infiniband: Replace usnic_ib_netdev_event_to_string() with netdev_cmd_to_name() net: Drop NETDEV_UNREGISTER_FINAL drivers/infiniband/hw/qedr/main.c |

[PATCH net-next 2/2] net: Drop NETDEV_UNREGISTER_FINAL

2018-03-23 Thread Kirill Tkhai
ned-off-by: Kirill Tkhai --- drivers/infiniband/hw/qedr/main.c |4 ++-- include/linux/netdevice.h |1 - include/rdma/ib_verbs.h |4 ++-- net/core/dev.c|6 -- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/infiniband/hw/q

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

2018-03-22 Thread Kirill Tkhai
. Also, David Howells acked rxrpc_net_ops, so I resend the patch in case of it should be queued by patchwork: https://www.spinics.net/lists/netdev/msg490678.html Thanks, Kirill --- Kirill Tkhai (2): net: Convert udp_sysctl_ops net: Convert rxrpc_net_ops net/ipv4/udp.c |3

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

2018-03-22 Thread Kirill Tkhai
These pernet_operations modifies rxrpc_net_id-pointed per-net entities. There is external link to AF_RXRPC in fs/afs/Kconfig, but it seems there is no other pernet_operations interested in that per-net entities. Signed-off-by: Kirill Tkhai Acked-by: David Howells --- net/rxrpc/net_ns.c |1

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

2018-03-22 Thread Kirill Tkhai
These pernet_operations just initialize udp4 defaults. Signed-off-by: Kirill Tkhai --- net/ipv4/udp.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 908fc02fb4f8..c6dc019bc64b 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c

Re: [PATCH net-next 06/14] net/tls: Add generic NIC offload infrastructure

2018-03-22 Thread Kirill Tkhai
On 22.03.2018 15:38, Boris Pismenny wrote: > ... Can't we move this check in tls_dev_event() and use it for all types of events? Then we avoid duplicate code. >>> >>> No. Not all events require this check. Also, the result is different for >>> different events. >> >> No.

Re: [PATCH net-next v3 0/5] Rework ip_ra_chain protection

2018-03-22 Thread Kirill Tkhai
On 22.03.2018 12:44, Kirill Tkhai wrote: > Commit 1215e51edad1 "ipv4: fix a deadlock in ip_ra_control" > made rtnl_lock() be used in raw_close(). This function is called > on every RAW socket destruction, so that rtnl_mutex is taken > every time. This scales very sadly.

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

2018-03-22 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 v3 5/5] net: Replace ip_ra_lock with per-net mutex

2018-03-22 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

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

2018-03-22 Thread Kirill Tkhai
. Previous patch moved IP_ROUTER_ALERT out of rtnl_lock(), so we revert this patch. Signed-off-by: Kirill Tkhai --- net/ipv4/ip_sockglue.c |1 - net/ipv4/ipmr.c| 11 +-- net/ipv4/raw.c |2 -- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/net/ipv4

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

2018-03-22 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 v3 0/5] Rework ip_ra_chain protection

2018-03-22 Thread Kirill Tkhai
destruct() in the future. Thanks, Kirill --- v3: Change patches order: [2/5] and [3/5]. v2: Fix sparse warning [4/5], as reported by kbuild test robot. --- Kirill Tkhai (5): net: Revert "ipv4: get rid of ip_ra_lock" net: Move IP_ROUTER_ALERT out of lock_sock(sk) n

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

2018-03-22 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 +++

Re: [PATCH V2 net-next 06/14] net/tls: Add generic NIC offload infrastructure

2018-03-21 Thread Kirill Tkhai
Hi, Saeed, thanks for fixing some of my remarks, but I've dived into the code more deeply, and found with a sadness, the patch lacks the readability. It too big and not fit kernel coding style. Please, see some comments below. Can we do something with patch length? Is there a way to split it in

Re: [PATCH net-next 06/14] net/tls: Add generic NIC offload infrastructure

2018-03-21 Thread Kirill Tkhai
On 21.03.2018 18:53, Boris Pismenny wrote: > ... >> >> Other patches have two licenses in header. Can I distribute this file under >> GPL license terms? >> > > Sure, I'll update the license to match other files under net/tls. > >>> +#include >>> +#include >>> +#include >>> +#include >>> +#in

Re: [PATCH net-next 06/14] net/tls: Add generic NIC offload infrastructure

2018-03-21 Thread Kirill Tkhai
On 20.03.2018 05:45, Saeed Mahameed wrote: > From: Ilya Lesokhin > > This patch adds a generic infrastructure to offload TLS crypto to a > network devices. It enables the kernel TLS socket to skip encryption > and authentication operations on the transmit side of the data path. > Leaving those co

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

2018-03-20 Thread Kirill Tkhai
On 20.03.2018 22:25, Kirill Tkhai wrote: > Hi, David, > > thanks for the review! > > On 20.03.2018 19:23, David Miller wrote: >> From: Kirill Tkhai >> Date: Mon, 19 Mar 2018 12:14:54 +0300 >> >>> This reverts commit 1215e51edad1. >>> Since

  1   2   3   4   5   >