[PATCH net-next] net: remove the new_ifindex argument from dev_change_net_namespace

2021-04-06 Thread Andrei Vagin
index when device is moved to another namespace") Suggested-by: Jakub Kicinski Signed-off-by: Andrei Vagin --- drivers/net/hyperv/netvsc_drv.c | 2 +- include/linux/netdevice.h | 8 +++- net/core/dev.c | 10 +- net/core/rtnetlink.c| 4

[PATCH net-next] net: introduce nla_policy for IFLA_NEW_IFINDEX

2021-04-06 Thread Andrei Vagin
In this case, we don't need to check that new_ifindex is positive in validate_linkmsg. Fixes: eeb85a14ee34 ("net: Allow to specify ifindex when device is moved to another namespace") Suggested-by: Jakub Kicinski Signed-off-by: Andrei Vagin --- net/core/rtnetlink.c | 4 +--- 1

[PATCH net-next v4] net: Allow to specify ifindex when device is moved to another namespace

2021-04-06 Thread Andrei Vagin
em is that devices have to be restored with the same indexes that they have before C/R. Cc: Alexander Mikhalitsyn Suggested-by: Christian Brauner Reviewed-by: Christian Brauner Signed-off-by: Andrei Vagin --- v2: initialize new_ifindex to 0 in do_setlink. v3: check that new_ifindex is positiv

[PATCH] net: Allow to specify ifindex when device is moved to another namespace

2021-04-05 Thread Andrei Vagin
em is that devices have to be restored with the same indexes that they have before C/R. Cc: Alexander Mikhalitsyn Suggested-by: Christian Brauner Signed-off-by: Andrei Vagin --- drivers/net/hyperv/netvsc_drv.c | 2 +- include/linux/netdevice.h | 3 ++- net/core/dev.c

Re: [PATCH net-next] net: Allow to specify ifindex when device is moved to another namespace

2021-04-02 Thread Andrei Vagin
On Fri, Apr 02, 2021 at 10:20:14AM +0200, Christian Brauner wrote: > > @@ -11043,6 +11046,11 @@ int dev_change_net_namespace(struct net_device > > *dev, struct net *net, const char > > goto out; > > } > > > > + /* Check that new_ifindex isn't used yet. */ > > + err =

[PATCH net-next v2] net: Allow to specify ifindex when device is moved to another namespace

2021-04-02 Thread Andrei Vagin
restored, then CRIU will restore network namespaces and move devices into them. The problem is that devices have to be restored with the same indexes that they have before C/R. Cc: Alexander Mikhalitsyn Suggested-by: Christian Brauner Signed-off-by: Andrei Vagin --- v2: initialize new_ifindex to 0 in

Re: [PATCH net-next] net: Allow to specify ifindex when device is moved to another namespace

2021-04-02 Thread Andrei Vagin
On Fri, Apr 02, 2021 at 12:36:22AM -0700, Andrei Vagin wrote: > diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c > index 1bdcb33fb561..9508d3a0a28f 100644 > --- a/net/core/rtnetlink.c > +++ b/net/core/rtnetlink.c > @@ -2603,14 +2603,20 @@ static int do_setlink(const stru

[PATCH net-next] net: Allow to specify ifindex when device is moved to another namespace

2021-04-02 Thread Andrei Vagin
restored, then CRIU will restore network namespaces and move devices into them. The problem is that devices have to be restored with the same indexes that they have before C/R. Cc: Alexander Mikhalitsyn Suggested-by: Christian Brauner Signed-off-by: Andrei Vagin --- drivers/net/hyperv/netvsc_drv.c

Re: [PATCH net] tcp: repaired skbs must init their tso_segs

2019-02-26 Thread Andrei Vagin
On Sat, Feb 23, 2019 at 03:51:51PM -0800, Eric Dumazet wrote: > syzbot reported a WARN_ON(!tcp_skb_pcount(skb)) > in tcp_send_loss_probe() [1] > > This was caused by TCP_REPAIR sent skbs that inadvertenly > were missing a call to tcp_init_tso_segs() > > [1] > WARNING: CPU: 1 PID: 0 at net/ipv4/tc

linux-next: BUG: KASAN: use-after-free in neigh_mark_dead+0x192/0x1c0

2018-12-08 Thread Andrei Vagin
Hi David, Our tests detected a new problem on net-next (v4.20-rc4-1241-g83af01ba1c2d). [ 92.949574] == [ 92.949794] BUG: KASAN: use-after-free in neigh_mark_dead+0x192/0x1c0 [ 92.949950] Write of size 8 at addr 8881d9bc943

[PATCH] sock_diag: fix autoloading of the raw_diag module

2018-11-04 Thread Andrei Vagin
IPPROTO_TCP isn't registred as an inet protocol, so inet_protos[protocol] is always NULL for it. Cc: Cyrill Gorcunov Cc: Xin Long Fixes: bf2ae2e4bf93 ("sock_diag: request _diag module only when the family or proto has been registered") Signed-off-by: Andrei Vagin --- net/core/

[PATCH net-next] net: add an empty __netif_set_xps_queue() stab in the !CONFIG_XPS case

2018-08-09 Thread Andrei Vagin
From: Andrei Vagin __netif_set_xps_queue() is used in drivers/net/virtio_net.c. Fixes: 4d99f6602cb5 ("net: allow to call netif_reset_xps_queues() under cpus_read_lock") Signed-off-by: Andrei Vagin --- include/linux/netdevice.h | 7 +++ 1 file changed, 7 insertions(+) di

[PATCH net-next v2] net: allow to call netif_reset_xps_queues() under cpus_read_lock

2018-08-08 Thread Andrei Vagin
From: Andrei Vagin The definition of static_key_slow_inc() has cpus_read_lock in place. In the virtio_net driver, XPS queues are initialized after setting the queue:cpu affinity in virtnet_set_affinity() which is already protected within cpus_read_lock. Lockdep prints a warning when we are

Re: [net-next, v6, 6/7] net-sysfs: Add interface for Rx queue(s) map per Tx queue

2018-07-18 Thread Andrei Vagin
On Tue, Jul 10, 2018 at 07:28:49PM -0700, Nambiar, Amritha wrote: > On 7/4/2018 12:20 AM, Andrei Vagin wrote: > > Hello Amritha, > > > > I see a following warning on 4.18.0-rc3-next-20180703. > > It looks like a problem is in this ser

Re: [net-next, v6, 6/7] net-sysfs: Add interface for Rx queue(s) map per Tx queue

2018-07-04 Thread Andrei Vagin
Hello Amritha, I see a following warning on 4.18.0-rc3-next-20180703. It looks like a problem is in this series. [1.084722] [1.084797] WARNING: possible recursive locking detected [1.084872] 4.18.0-rc3-next-20180703+ #1 Not tainted [1.0

Re: [PATCH] net: split sk_reuse into sk_reuse and sk_force_reuse

2018-06-14 Thread Andrei Vagin
On Wed, Jun 13, 2018 at 06:17:41PM -0700, Eric Dumazet wrote: > On Wed, Jun 13, 2018 at 5:56 PM Andrei Vagin wrote: > > > The commit f396922d862a added a check to not allow changing > > SO_REUSEADDR/SO_REUSEPORT on bound sockets. First, it doesn't > > take into ac

[PATCH] net: split sk_reuse into sk_reuse and sk_force_reuse

2018-06-13 Thread Andrei Vagin
ORT on bound sockets") Cc: Maciej Żenczykowski Cc: Eric Dumazet Signed-off-by: Andrei Vagin --- include/net/sock.h | 13 - net/ipv4/inet_connection_sock.c | 2 +- net/ipv4/tcp.c | 4 ++-- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git

Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-11 Thread Andrei Vagin
On Sun, Jun 03, 2018 at 10:47:05AM -0700, Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > It is not safe to do so because such sockets are already in the > hash tables and changing these options can result in invalidating > the tb->fastreuse(port) caching. > > This can have later far

Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-11 Thread Andrei Vagin
existing network namespace. > > Could we perhaps instead allow a new namespace to ignore bind conflicts until > we flip it into enforcing mode? No, we could not >From 990baa56993827ae6f4441cf078eddf73389d6ee Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Fri, 8 Jun 2018 23:27:46 -

Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-06 Thread Andrei Vagin
On Wed, Jun 06, 2018 at 05:25:51PM -0700, Maciej Żenczykowski wrote: > Yes, it does, we found this internally last night and been debating > what to do about it. > > Fundamentally what it points out is that prior to this patch CRIU > could get the host into an inconsistent state. Yes, I understan

Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-06 Thread Andrei Vagin
This patch breaks CRIU tests: = Run zdtm/transition/socket-tcp6 in h = Start test ./socket-tcp6 --pidfile=socket-tcp6.pid --outfile=socket-tcp6.out start time for zdtm/transition/socket-tcp6: 0.90 Run criu dump Run criu restore =[log]=> dump/zdtm/transition/

Re: linux-next: BUG: KASAN: use-after-free in tun_chr_close

2018-05-16 Thread Andrei Vagin
On Wed, May 16, 2018 at 03:32:59PM +0800, Jason Wang wrote: > > > On 2018年05月16日 15:12, Andrei Vagin wrote: > > Hi Jason, > > > > I think the problem is in "tun: hold a tun socket during ptr_ring_cleanup". > > > > Pls take a look at the attac

Re: linux-next: BUG: KASAN: use-after-free in tun_chr_close

2018-05-16 Thread Andrei Vagin
Hi Jason, I think the problem is in "tun: hold a tun socket during ptr_ring_cleanup". Pls take a look at the attached patch. On Tue, May 15, 2018 at 11:28:25PM -0700, Andrei Vagin wrote: > We run CRIU tests on linux-next regularly and today we caught this bug: > > https://t

linux-next: BUG: KASAN: use-after-free in tun_chr_close

2018-05-15 Thread Andrei Vagin
We run CRIU tests on linux-next regularly and today we caught this bug: https://travis-ci.org/avagin/linux/jobs/379450631 [ 50.264837] == [ 50.264986] BUG: KASAN: use-after-free in __lock_acquire.isra.30+0x1ad4/0x1bb0 [ 50.26

Re: possible deadlock in sk_diag_fill

2018-05-14 Thread Andrei Vagin
On Tue, May 15, 2018 at 07:19:39AM +0200, Dmitry Vyukov wrote: > On Mon, May 14, 2018 at 8:00 PM, Andrei Vagin wrote: > >> >> Hello, > >> >> > >> >> syzbot found the following crash on: > >> >> > >> >> HEAD

Re: possible deadlock in sk_diag_fill

2018-05-14 Thread Andrei Vagin
On Sat, May 12, 2018 at 09:46:25AM +0200, Dmitry Vyukov wrote: > On Fri, May 11, 2018 at 8:33 PM, Andrei Vagin wrote: > > On Sat, May 05, 2018 at 10:59:02AM -0700, syzbot wrote: > >> Hello, > >> > >> syzbot found the following crash on: > >> > &

Re: possible deadlock in sk_diag_fill

2018-05-11 Thread Andrei Vagin
On Sat, May 05, 2018 at 10:59:02AM -0700, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:c1c07416cdd4 Merge tag 'kbuild-fixes-v4.17' of git://git.k.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=12164c9780 > kernel

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

2018-04-20 Thread Andrei Vagin
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 may not have permission to open > it. > > Patch makes /run/xtables.lock to be per

[v4.15.9] BUG: KASAN: slab-out-of-bounds in __dev_queue_xmit+0x2e5/0x14c0

2018-03-13 Thread Andrei Vagin
Hi, I got the following warning on the v4.15.9 kernel. :[ 4483.052174] == :[ 4483.052659] BUG: KASAN: slab-out-of-bounds in __dev_queue_xmit+0x2e5/0x14c0 :[ 4483.052937] Read of size 1 at addr 880067ef7bc0 by task objtool/26177

Re: [PATCH v2 00/31] Replacing net_mutex with rw_semaphore

2018-01-18 Thread Andrei Vagin
real 0m17,007s > user 0m5,311s > sys 0m11,779 > > (5.8 times faster) Good job! Acked-by: Andrei Vagin > --- > > Kirill Tkhai (31): > net: Assign net to net_namespace_list in setup_net() > net: Cleanup copy_net_ns() >

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Andrei Vagin
On Thu, Jan 18, 2018 at 01:06:52AM +0100, Andrew Lunn wrote: > > What is the idea to have two separate counters? Can a delta between them > > be a bigger than 1? > > Yes, it can. > > These counters are incremented in netif_carrier_on() / > netif_carrier_off(). They are not always called in pairs

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Andrei Vagin
On Wed, Jan 17, 2018 at 03:06:57PM -0800, Florian Fainelli wrote: > From: David Decotigny > > Expose the number of times the link has been going UP or DOWN, and > update the "carrier_changes" counter to be the sum of these two events. > While at it, also update the sysfs-class-net documentation t

Re: [PATCH v2 03/31] net: Introduce net_sem for protection of pernet_list

2018-01-17 Thread Andrei Vagin
On Mon, Nov 20, 2017 at 09:32:34PM +0300, Kirill Tkhai wrote: > Curently mutex is used to protect pernet operations list. It makes > cleanup_net() to execute ->exit methods of the same operations set, > which was used on the time of ->init, even after net namespace is > unlinked from net_namespace_

Re: [PATCH v2 05/31] net: Allow pernet_operations to be executed in parallel

2018-01-17 Thread Andrei Vagin
On Mon, Nov 20, 2017 at 09:32:55PM +0300, Kirill Tkhai wrote: > This adds new pernet_operations::async flag to indicate operations, > which ->init(), ->exit() and ->exit_batch() methods are allowed > to be executed in parallel with the methods of any other pernet_operations. > > When there are onl

Re: general protection fault in __netlink_ns_capable

2018-01-04 Thread Andrei Vagin
On Thu, Jan 04, 2018 at 01:01:17PM +0100, Dmitry Vyukov wrote: > On Wed, Jan 3, 2018 at 8:37 AM, Andrei Vagin wrote: > >> > Hello, > >> > > >> > syzkaller hit the following crash on > >> > 75aa5540627fdb3d8f86229776ea87f995275351 > >> &g

[PATCH v2] rtnetlink: give a user socket to get_target_net()

2018-01-03 Thread Andrei Vagin
nline] netlink_unicast+0x4be/0x6a0 net/netlink/af_netlink.c:1334 netlink_sendmsg+0xa4a/0xe60 net/netlink/af_netlink.c:1897 Cc: Jiri Benc Fixes: 79e1ad148c84 ("rtnetlink: use netnsid to query interface") Reported-by: syzbot+e432865c29eb4c48c...@syzkaller.appspotmail.com Signed-off-by: Andrei

Re: general protection fault in __netlink_ns_capable

2018-01-02 Thread Andrei Vagin
On Tue, Jan 02, 2018 at 04:35:11PM -0800, Andrei Vagin wrote: > On Tue, Jan 02, 2018 at 10:58:01AM -0800, syzbot wrote: > > Hello, > > > > syzkaller hit the following crash on > > 75aa5540627fdb3d8f86229776ea87f995275351 > > git://git.cmpxchg.org/linux-mmots.

[PATCH] rtnetlink: give a user socket to get_target_net()

2018-01-02 Thread Andrei Vagin
nline] netlink_unicast+0x4be/0x6a0 net/netlink/af_netlink.c:1334 netlink_sendmsg+0xa4a/0xe60 net/netlink/af_netlink.c:1897 Cc: Jiri Benc Fixes: 79e1ad148c84 ("rtnetlink: use netnsid to query interface") Signed-off-by: Andrei Vagin --- net/core/rtnetlink.c | 10 +- 1 file change

Re: general protection fault in __netlink_ns_capable

2018-01-02 Thread Andrei Vagin
On Tue, Jan 02, 2018 at 10:58:01AM -0800, syzbot wrote: > Hello, > > syzkaller hit the following crash on > 75aa5540627fdb3d8f86229776ea87f995275351 > git://git.cmpxchg.org/linux-mmots.git/master > compiler: gcc (GCC) 7.1.1 20170620 > .config is attached > Raw console output is attached. > C repro

BUG: unable to handle kernel NULL pointer dereference in fdb_find_rcu

2017-12-15 Thread Andrei Vagin
Hi, We run criu tests for linux-next and today we get this bug: The kernel version is 4.15.0-rc3-next-20171215 [ 235.397328] BUG: unable to handle kernel NULL pointer dereference at 000c [ 235.398624] IP: fdb_find_rcu+0x3c/0x130 [ 235.399365] PGD 51970067 P4D 51970067 PUD 51971067

Re: [PATCH] net: Convert net_mutex into rw_semaphore and down read it on net->init/->exit

2017-11-14 Thread Andrei Vagin
On Tue, Nov 14, 2017 at 10:00:59AM -0800, Eric Dumazet wrote: > On Tue, 2017-11-14 at 09:44 -0800, Andrei Vagin wrote: > > On Tue, Nov 14, 2017 at 04:53:33PM +0300, Kirill Tkhai wrote: > > > Curently mutex is used to protect pernet operations list. It makes > > > clea

Re: [PATCH] net: Convert net_mutex into rw_semaphore and down read it on net->init/->exit

2017-11-14 Thread Andrei Vagin
On Tue, Nov 14, 2017 at 09:04:06PM +0300, Kirill Tkhai wrote: > On 14.11.2017 20:44, Andrei Vagin wrote: > > On Tue, Nov 14, 2017 at 04:53:33PM +0300, Kirill Tkhai wrote: > >> Curently mutex is used to protect pernet operations list. It makes > >> cleanup_net() to ex

Re: [PATCH] net: Convert net_mutex into rw_semaphore and down read it on net->init/->exit

2017-11-14 Thread Andrei Vagin
On Tue, Nov 14, 2017 at 04:53:33PM +0300, Kirill Tkhai wrote: > Curently mutex is used to protect pernet operations list. It makes > cleanup_net() to execute ->exit methods of the same operations set, > which was used on the time of ->init, even after net namespace is > unlinked from net_namespace_

Re: [PATCH] net/unix: don't show information about sockets from other namespaces

2017-10-25 Thread Andrei Vagin
On Wed, Oct 25, 2017 at 06:37:16AM -0700, Eric Dumazet wrote: > On Wed, 2017-10-25 at 00:17 -0700, Andrei Vagin wrote: > > socket_diag shows information only about sockets from a namespace where > > a diag socket lives. > > > > But if we request information about one un

[PATCH v2] net/unix: don't show information about sockets from other namespaces

2017-10-25 Thread Andrei Vagin
This looks like a bug. v2: add a Fixes tag Fixes: 51d7cccf0723 ("net: make sock diag per-namespace") Signed-off-by: Andrei Vagin --- net/unix/diag.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/unix/diag.c b/net/unix/diag.c index 4d9679701a6d..384c84e83462 100644 --- a/

[PATCH] net/unix: don't show information about sockets from other namespaces

2017-10-25 Thread Andrei Vagin
This looks like a bug. Signed-off-by: Andrei Vagin --- net/unix/diag.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/unix/diag.c b/net/unix/diag.c index 4d96797..384c84e 100644 --- a/net/unix/diag.c +++ b/net/unix/diag.c @@ -257,6 +257,8 @@ static int unix_diag_get_exact(struct sk

Re: [RFC] net/unix_diag: Provide UDIAG_SHOW_VFS2 attribute to fetch complete inode number

2017-10-24 Thread Andrei Vagin
On Wed, Oct 25, 2017 at 12:48:14AM +0300, Cyrill Gorcunov wrote: > Currently unix_diag_vfs structure reports unix socket inode > as u32 value which of course doesn't fit to ino_t type and BTW: As far as I understand, it is not a problem right now, because get_next_ino returns int. And I'm agree th

net-next: del_timer_sync(): possible circular locking dependency detected

2017-10-19 Thread Andrei Vagin
Hi, We run criu tests on net-next/master regularly, and today tests triggered this warning: v4.14-rc4-1168-g7a0947e [ 23.922640] == [ 23.922735] WARNING: possible circular locking dependency detected [ 23.922823] 4.14.0-rc4+ #1 Not tainte

Re: [10/26] netfilter: Allow xt_owner in any user namespace

2017-10-18 Thread Andrei Vagin
On Wed, Jul 06, 2016 at 04:23:52PM +0200, Pablo Neira Ayuso wrote: > From: "Eric W. Biederman" > > Making this work is a little tricky as it really isn't kosher to > change the xt_owner_match_info in a check function. > > Without changing xt_owner_match_info we need to know the user > namespace

Re: net-next: WARNING: CPU: 0 PID: 1544 at net/ipv4/tcp_input.c:889

2017-10-16 Thread Andrei Vagin
_out = -1 state->reord = 4 In my case, this warning is triggered for connections which have been restored by CRIU. Let me know if you need any other information. I can reproduce this bugs for an hour. Thanks, Andrei On Mon, Oct 9, 2017 at 11:07 AM, Andrei Vagin wrote: > Hello, > > W

net-next: WARNING: CPU: 0 PID: 1544 at net/ipv4/tcp_input.c:889

2017-10-09 Thread Andrei Vagin
Hello, We run CRIU tests on a daily basis for net-next and today they triggered a following warning: [ 58.827039] [ cut here ] [ 58.827078] WARNING: CPU: 0 PID: 1544 at net/ipv4/tcp_input.c:889 tcp_update_reordering+0x9f/0xb0 [ 58.827083] Modules linked in: [ 58.8

Re: [CRIU] BUG: Dentry ffff9f795a08fe60{i=af565f, n=lo} still in use (1) [unmount of proc proc]

2017-07-07 Thread Andrei Vagin
On Thu, Jul 06, 2017 at 08:41:00AM -0500, Eric W. Biederman wrote: > Andrei Vagin writes: > > > I did a few experiments and found that the bug is reproduced for 6-12 > > hours on the our test server. Then I reverted two patches and the server > > is working normall

Re: [CRIU] BUG: Dentry ffff9f795a08fe60{i=af565f, n=lo} still in use (1) [unmount of proc proc]

2017-07-03 Thread Andrei Vagin
On Fri, Jun 30, 2017 at 12:11:07PM -0700, Andrei Vagin wrote: > On Thu, Jun 29, 2017 at 08:42:23PM -0500, Eric W. Biederman wrote: > > Andrei Vagin writes: > > > > > On Thu, Jun 29, 2017 at 12:06 PM, Eric W. Biederman > > > wrote: > > >&g

Re: [CRIU] BUG: Dentry ffff9f795a08fe60{i=af565f, n=lo} still in use (1) [unmount of proc proc]

2017-06-30 Thread Andrei Vagin
On Thu, Jun 29, 2017 at 08:42:23PM -0500, Eric W. Biederman wrote: > Andrei Vagin writes: > > > On Thu, Jun 29, 2017 at 12:06 PM, Eric W. Biederman > > wrote: > >> Andrei Vagin writes: > >> > >>> Hello, > >>> > >

Re: BUG: Dentry ffff9f795a08fe60{i=af565f,n=lo} still in use (1) [unmount of proc proc]

2017-06-29 Thread Andrei Vagin
On Thu, Jun 29, 2017 at 12:06 PM, Eric W. Biederman wrote: > Andrei Vagin writes: > >> Hello, >> >> We run CRIU tests on linus' tree and today we found this issue. >> >> CRIU tests are the set of small programs to check checkpoint/restore >> o

Re: unregister_netdevice: waiting for lo to become free. Usage count = 1

2017-06-23 Thread Andrei Vagin
On Fri, Jun 23, 2017 at 02:49:58PM -0700, Andrei Vagin wrote: > Hello Everyone, > > Today I've met a problem, when any attempts to create a new network > namespace hang up. > I see that one of previous namespaces can't be destroyed, because a > usage count for one >

unregister_netdevice: waiting for lo to become free. Usage count = 1

2017-06-23 Thread Andrei Vagin
Hello Everyone, Today I've met a problem, when any attempts to create a new network namespace hang up. I see that one of previous namespaces can't be destroyed, because a usage count for one of its devices isn't zero. To reproduce the problem, you need to executed an attached program in a separate

[PATCH net-next v2] net: fix __skb_try_recv_from_queue to return the old behavior

2017-05-17 Thread Andrei Vagin
r out dequeue/peek with offset cod") Signed-off-by: Andrei Vagin --- net/core/datagram.c | 14 -- net/ipv4/udp.c | 12 +++- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/net/core/datagram.c b/net/core/datagram.c index a4592b4..bc46118 100644 ---

[PATCH net-next] net: fix __skb_try_recv_from_queue to return the old behavior

2017-05-16 Thread Andrei Vagin
ned-off-by: Andrei Vagin --- net/core/datagram.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/core/datagram.c b/net/core/datagram.c index a4592b4..bc46118 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -170,20 +170,21 @@ stru

Re: [net-next,v2,1/3] net/sock: factor out dequeue/peek with offset code

2017-05-16 Thread Andrei Vagin
On Tue, May 16, 2017 at 11:20:13AM +0200, Paolo Abeni wrote: > And update __sk_queue_drop_skb() to work on the specified queue. > This will help the udp protocol to use an additional private > rx queue in a later patch. CRIU tests fails with this patch: recvmsg(14, {msg_name=NULL, msg_namelen=0,

[PATCH net-next] netlink/diag: report flags for netlink sockets

2017-04-03 Thread Andrei Vagin
about sockets than proc files. We use these flags to dump and restore netlink sockets. Signed-off-by: Andrei Vagin --- include/uapi/linux/netlink_diag.h | 10 ++ net/netlink/af_netlink.c | 8 net/netlink/af_netlink.h | 8 net/netlink/diag.c

[PATCH] ss: replace all zero characters in a unix name to '@'

2017-03-31 Thread Andrei Vagin
From: Andrei Vagin A name of an abstract socket can contain zero characters. Now we replace only the first character. If a name contains more than one zero character, the ss tool shows only a part of the name: u_str UNCONN00 @1931097 * 0 the output

Re: linux-next: WARNING: CPU: 1 PID: 19544 at net/bridge/br_fdb.c:109 br_fdb_find+0x19d/0x1b0

2017-03-16 Thread Andrei Vagin
On Wed, Mar 15, 2017 at 9:19 PM, Cong Wang wrote: > On Wed, Mar 15, 2017 at 6:12 PM, Andrei Vagin wrote: >> Hello, >> >> We execute CRIU tests for linux-next and here is a new warning: >> [ 178.930950] [ cut here ] >> [ 178.930960]

linux-next: WARNING: CPU: 1 PID: 19544 at net/bridge/br_fdb.c:109 br_fdb_find+0x19d/0x1b0

2017-03-15 Thread Andrei Vagin
Hello, We execute CRIU tests for linux-next and here is a new warning: [ 178.930950] [ cut here ] [ 178.930960] WARNING: CPU: 1 PID: 19544 at net/bridge/br_fdb.c:109 br_fdb_find+0x19d/0x1b0 [ 178.930961] Modules linked in: [ 178.930966] CPU: 1 PID: 19544 Comm: criu Not

[PATCH net-next] net/8021q: create device with all possible features in wanted_features

2017-03-15 Thread Andrei Vagin
features ... Cc: Alexey Kuznetsov Cc: Patrick McHardy Cc: "David S. Miller" Signed-off-by: Andrei Vagin --- net/8021q/vlan_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 10da6c5..b9ad2f8 1006

[PATCH] net: use net->count to check whether a netns is alive or not

2017-03-12 Thread Andrei Vagin
st_empty(&net->exit_list) always returns false. Reported-by: Mantas Mikulėnas Fixes: 002d8a1a6c11 ("net: skip genenerating uevents for network namespaces that are exiting") Signed-off-by: Andrei Vagin --- net/core/net-sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 delet

Re: regression (4.10) - interface remove uevents not generated

2017-03-11 Thread Andrei Vagin
On Sat, Mar 11, 2017 at 11:24:34PM +0200, Mantas Mikulėnas wrote: > On 2017-03-11 21:50, Andrei Vagin wrote: > > Hi Mantas, > > > > Thank you for the report. Could you try out the attached patch? > > Thanks, I tested it on current master but it doesn't seem t

Re: regression (4.10) - interface remove uevents not generated

2017-03-11 Thread Andrei Vagin
Hi Mantas, Thank you for the report. Could you try out the attached patch? On Sat, Mar 11, 2017 at 05:10:22PM +0200, Mantas Mikulėnas wrote: > Hello, > > It seems that commit 002d8a1a6c11b9b2a8ac615095589111dd52749b ("net: > skip genenerating uevents for network namespaces that are exiting") > b

[PATCH net-next] unix: add ioctl to open a unix socket file with O_PATH

2017-02-01 Thread Andrei Vagin
os:0 flags: 01200 mnt_id: 40 $ cat /proc/self/mountinfo | grep "^40\s" 40 19 0:37 / /tmp rw shared:23 - tmpfs tmpfs rw Signed-off-by: Andrei Vagin --- include/uapi/linux/un.h | 2 ++ net/unix/af_unix.c | 41 + 2 files changed, 43 inse

Re: [Patch net] net: check dead netns for peernet2id_alloc()

2016-11-16 Thread Andrei Vagin
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. It works for me and looks good. Thanks. Acked-by: Andrei Vagin > >

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-15 Thread Andrei Vagin
On Tue, Nov 15, 2016 at 2:21 PM, Andrei Vagin wrote: > On Tue, Nov 15, 2016 at 1:07 PM, Cong Wang wrote: >> On Tue, Nov 15, 2016 at 12:48 PM, Andrei Vagin wrote: >>> On Tue, Nov 15, 2016 at 10:50 AM, Cong Wang >>> wrote: >>>> On Tue, Nov 15, 2016 at 10:

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-15 Thread Andrei Vagin
On Tue, Nov 15, 2016 at 1:07 PM, Cong Wang wrote: > On Tue, Nov 15, 2016 at 12:48 PM, Andrei Vagin wrote: >> On Tue, Nov 15, 2016 at 10:50 AM, Cong Wang wrote: >>> On Tue, Nov 15, 2016 at 10:04 AM, Cong Wang >>> wrote: >>>> On Mon, Nov 14, 2016 at

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-15 Thread Andrei Vagin
On Tue, Nov 15, 2016 at 10:50 AM, Cong Wang wrote: > On Tue, Nov 15, 2016 at 10:04 AM, Cong Wang wrote: >> On Mon, Nov 14, 2016 at 10:23 PM, Andrei Vagin wrote: >>> Hi Nicolas, >>> >>> cleanup_net() calls idr_destroy(net->netns_ids) for n

Re: linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-14 Thread Andrei Vagin
On Mon, Nov 14, 2016 at 10:23 PM, Andrei Vagin wrote: > Hi Nicolas, > > cleanup_net() calls idr_destroy(net->netns_ids) for network namespaces > and then it calls unregister_netdevice_many() which calls > idr_alloc(net0>netns_ids). It looks wrong, doesn't it? Here

linux-next: net->netns_ids is used after calling idr_destroy for it

2016-11-14 Thread Andrei Vagin
Hi Nicolas, cleanup_net() calls idr_destroy(net->netns_ids) for network namespaces and then it calls unregister_netdevice_many() which calls idr_alloc(net0>netns_ids). It looks wrong, doesn't it? I compiled the kernel with the next patch: diff --git a/lib/idr.c b/lib/idr.c index 6098336..c0a3a32

[PATCH net-next] tcp: allow to enable the repair mode for non-listening sockets

2016-11-14 Thread Andrei Vagin
enable repair mode for these sockets. The repair mode reveals nothing more for sockets in other states. Signed-off-by: Andrei Vagin --- net/ipv4/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 3251fe7..a2a3a8c 100644 --- a/net/ipv4

Re: linux-next: BUG: unable to handle kernel NULL pointer dereference in __sk_mem_raise_allocated()

2016-11-14 Thread Andrei Vagin
On Mon, Nov 14, 2016 at 3:24 PM, Andrei Vagin wrote: > Hi Paolo, > > Our test system detected a kernel oops. Looks like a problem in the > "udp: refactor memory accounting" series. > > # good: [f970bd9e3a06f06df8d8ecf1f8ad2c8615cc17eb] udp: implement > memory accou

Re: linux-next: BUG: unable to handle kernel NULL pointer dereference in __sk_mem_raise_allocated()

2016-11-14 Thread Andrei Vagin
On Mon, Nov 14, 2016 at 3:35 PM, Eric Dumazet wrote: > On Mon, 2016-11-14 at 15:24 -0800, Andrei Vagin wrote: >> Hi Paolo, >> >> Our test system detected a kernel oops. Looks like a problem in the >> "udp: refactor memory accounting" series. >> >>

linux-next: BUG: unable to handle kernel NULL pointer dereference in __sk_mem_raise_allocated()

2016-11-14 Thread Andrei Vagin
Hi Paolo, Our test system detected a kernel oops. Looks like a problem in the "udp: refactor memory accounting" series. # good: [f970bd9e3a06f06df8d8ecf1f8ad2c8615cc17eb] udp: implement memory accounting helpers git bisect good f970bd9e3a06f06df8d8ecf1f8ad2c8615cc17eb # bad: [2d0e30c30f84d08dc16f

[PATCH v2] net: skip genenerating uevents for network namespaces that are exiting

2016-10-24 Thread Andrei Vagin
Cong Wang Cc: "David S. Miller" Cc: Eric W. Biederman Signed-off-by: Andrei Vagin --- net/core/net-sysfs.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 6e4f347..d4fe286 100644 --- a/net/core/ne

[PATCH net-next] net: add an ioctl to get a socket network namespace

2016-10-24 Thread Andrei Vagin
This patch introduces a new socket ioctl, which is called SIOCGSKNS and used to get a file descriptor for a socket network namespace. A task must have CAP_NET_ADMIN in a target network namespace to use this ioctl. Cc: "David S. Miller" Cc: Eric W. Biederman Signed-off-by: Andrei Vagin

[PATCH net-next] net: allow to kill a task which waits net_mutex in copy_new_ns

2016-10-20 Thread Andrei Vagin
David S. Miller" Cc: Eric W. Biederman Signed-off-by: Andrei Vagin --- net/core/net_namespace.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 989434f..b9243b1 100644 --- a/net/core/net_namespace.c +++

[PATCH] net: skip genenerating uevents for network namespaces that are exiting

2016-10-20 Thread Andrei Vagin
twork namespaces, because they are destroyed under net_mutex and many namespaces can be destroyed for one iteration. Cc: "David S. Miller" Cc: Eric W. Biederman Signed-off-by: Andrei Vagin --- net/core/net-sysfs.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) d

Re: [PATCH] net: limit a number of namespaces which can be cleaned up concurrently

2016-10-14 Thread Andrei Vagin
On Thu, Oct 13, 2016 at 10:06:28PM -0500, Eric W. Biederman wrote: > Andrei Vagin writes: > > > On Thu, Oct 13, 2016 at 10:49:38AM -0500, Eric W. Biederman wrote: > >> Andrei Vagin writes: > >> > >> > From: Andrey Vagin > >> > >

Re: [PATCH] net: limit a number of namespaces which can be cleaned up concurrently

2016-10-13 Thread Andrei Vagin
On Thu, Oct 13, 2016 at 10:49:38AM -0500, Eric W. Biederman wrote: > Andrei Vagin writes: > > > From: Andrey Vagin > > > > The operation of destroying netns is heavy and it is executed under > > net_mutex. If many namespaces are destroyed concurrently, net_mute

[PATCH] net: limit a number of namespaces which can be cleaned up concurrently

2016-10-12 Thread Andrei Vagin
ot;David S. Miller" Cc: "Eric W. Biederman" Signed-off-by: Andrei Vagin --- net/core/net_namespace.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 989434f..33dd3b7 100644 --- a/net/core/net_n

Re: [PATCH net-next] netlink: don't forget to release a rhashtable_iter structure

2016-09-07 Thread Andrei Vagin
On Tue, Sep 06, 2016 at 05:41:37PM -0700, David Miller wrote: > From: Andrei Vagin > Date: Tue, 6 Sep 2016 11:23:39 -0700 > > > This bug was detected by kmemleak: > > unreferenced object 0x8804269cc3c0 (size 64): > > comm "criu", pid 1042, jiffies 42

[PATCH net-next v2] netlink: don't forget to release a rhashtable_iter structure

2016-09-06 Thread Andrei Vagin
s: ad202074320c ("netlink: Use rhashtable walk interface in diag dump") Signed-off-by: Andrei Vagin --- net/netlink/diag.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/netlink/diag.c b/net/netlink/diag.c index 3e3e253..b2f0e98 100644 --- a/net/netlink/diag.c +++ b/net/netlin

[PATCH net-next] netlink: don't forget to release a rhashtable_iter structure

2016-09-06 Thread Andrei Vagin
0 00 ad de backtrace: [] kmemleak_alloc+0x4a/0xa0 [] kmem_cache_alloc_trace+0x10f/0x280 [] __netlink_diag_dump+0x26c/0x290 [netlink_diag] Cc: Herbert Xu Fixes: ad202074320c ("netlink: Use rhashtable walk interface in diag dump") Signed-off-by: Andrei Vagin ---

Continue a discussion about the netlink interface

2016-08-24 Thread Andrei Vagin
Hello, I want to return to a discussion about the netlink interface and how to use it out of the network subsystem. I'm developing a new interface to get information about processes (task_diag). task_diag is like socket_diag but for processes. [0] In the first two versions [1] [2], I used the ne

Re: [PATCH v2 09/10] netns: Add a limit on the number of net namespaces

2016-07-25 Thread Andrei Vagin
On Thu, Jul 21, 2016 at 9:40 AM, Eric W. Biederman wrote: > Signed-off-by: "Eric W. Biederman" > --- > include/linux/user_namespace.h | 1 + > kernel/user_namespace.c| 1 + > net/core/net_namespace.c | 15 +++ > 3 files changed, 17 insertions(+) > > diff --git a/inclu