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

2016-07-26 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

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

2017-02-01 Thread Andrei Vagin
lags: 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 <ava...@openvz.org> --- include/uapi/linux/un.h | 2 ++ net/unix/af_unix.c | 41 + 2 files

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

[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 <herb...@gondor.apana.org.au> Fixes: ad202074320c ("netlink: Use rhashtable walk interface in diag dump&qu

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

2016-09-06 Thread Andrei Vagin
t Xu <herb...@gondor.apana.org.au> Fixes: ad202074320c ("netlink: Use rhashtable walk interface in diag dump") Signed-off-by: Andrei Vagin <ava...@openvz.org> --- net/netlink/diag.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/netlink/diag.c b/net/netlink/diag.c index 3e3e253..

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 <ava...@openvz.org> > Date: Tue, 6 Sep 2016 11:23:39 -0700 > > > This bug was detected by kmemleak: > > unreferenced object 0x8804269cc3c0 (size 64): > > comm "cr

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 <ava...@virtuozzo.com> writes: > > > On Thu, Oct 13, 2016 at 10:49:38AM -0500, Eric W. Biederman wrote: > >> Andrei Vagin <ava...@openvz.org> writes: > >> &g

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

2016-10-24 Thread Andrei Vagin
Cc: Eric W. Biederman <ebied...@xmission.com> Signed-off-by: Andrei Vagin <ava...@openvz.org> --- fs/nsfs.c| 2 +- include/linux/proc_fs.h | 4 include/uapi/linux/sockios.h | 1 + net/socket.c | 13 + 4 files changed, 19 insert

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

2016-10-24 Thread Andrei Vagin
Wang <xiyou.wangc...@gmail.com> Cc: "David S. Miller" <da...@davemloft.net> Cc: Eric W. Biederman <ebied...@xmission.com> Signed-off-by: Andrei Vagin <ava...@openvz.org> --- net/core/net-sysfs.c | 14 +++--- 1 file changed, 11 insertions(+), 3 delet

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

2016-10-20 Thread Andrei Vagin
aiting net_mutex. Cc: "David S. Miller" <da...@davemloft.net> Cc: Eric W. Biederman <ebied...@xmission.com> Signed-off-by: Andrei Vagin <ava...@openvz.org> --- net/core/net_namespace.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/n

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

2016-10-20 Thread Andrei Vagin
namespaces, because they are destroyed under net_mutex and many namespaces can be destroyed for one iteration. Cc: "David S. Miller" <da...@davemloft.net> Cc: Eric W. Biederman <ebied...@xmission.com> Signed-off-by: Andrei Vagin <ava...@openvz.org> --- net/core/net-sy

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 <eric.duma...@gmail.com> 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 m

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

2016-11-14 Thread Andrei Vagin
to enable repair mode for these sockets. The repair mode reveals nothing more for sockets in other states. Signed-off-by: Andrei Vagin <ava...@openvz.org> --- 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..a

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 <ava...@gmail.com> wrote: > Hi Paolo, > > Our test system detected a kernel oops. Looks like a problem in the > "udp: refactor memory accounting" series. > > # good: [f970bd9e3a06f06df8d8ecf1f8ad2c8615cc17eb] udp: imp

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 <ava...@gmail.com> 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, do

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

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

2016-11-16 Thread Andrei Vagin
, 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 <ava.

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 <xiyou.wangc...@gmail.com> wrote: > On Tue, Nov 15, 2016 at 10:04 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: >> On Mon, Nov 14, 2016 at 10:23 PM, Andrei Vagin <ava...@gmail.com> wrote: >>> Hi Nicolas, >>

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 <ava...@gmail.com> wrote: > On Tue, Nov 15, 2016 at 1:07 PM, Cong Wang <xiyou.wangc...@gmail.com> wrote: >> On Tue, Nov 15, 2016 at 12:48 PM, Andrei Vagin <ava...@gmail.com> wrote: >>> On Tue, Nov 15, 2016

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 <xiyou.wangc...@gmail.com> wrote: > On Tue, Nov 15, 2016 at 12:48 PM, Andrei Vagin <ava...@gmail.com> wrote: >> On Tue, Nov 15, 2016 at 10:50 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: >>> On Tue, Nov 15, 2016

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:

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:49:38AM -0500, Eric W. Biederman wrote: > Andrei Vagin <ava...@openvz.org> writes: > > > From: Andrey Vagin <ava...@openvz.org> > > > > The operation of destroying netns is heavy and it is executed under > > net_mutex. If

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

2016-10-12 Thread Andrei Vagin
k it's required. Cc: "David S. Miller" <da...@davemloft.net> Cc: "Eric W. Biederman" <ebied...@xmission.com> Signed-off-by: Andrei Vagin <ava...@openvz.org> --- net/core/net_namespace.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff

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
... Cc: Alexey Kuznetsov <kuz...@virtuozzo.com> Cc: Patrick McHardy <ka...@trash.net> Cc: "David S. Miller" <da...@davemloft.net> Signed-off-by: Andrei Vagin <ava...@openvz.org> --- net/8021q/vlan_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-

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 <xiyou.wangc...@gmail.com> wrote: > On Wed, Mar 15, 2017 at 6:12 PM, Andrei Vagin <ava...@gmail.com> wrote: >> Hello, >> >> We execute CRIU tests for linux-next and here is a new warning: >>

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

2017-04-03 Thread Andrei Vagin
report no less information about sockets than proc files. We use these flags to dump and restore netlink sockets. Signed-off-by: Andrei Vagin <ava...@openvz.org> --- include/uapi/linux/netlink_diag.h | 10 ++ net/netlink/af_netlink.c | 8 net/netlink/af_netlink.h

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

2017-03-31 Thread Andrei Vagin
From: Andrei Vagin <ava...@virtuozzo.com> 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 @1

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") >

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 to hel

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

2017-03-12 Thread Andrei Vagin
pty(>exit_list) always returns false. Reported-by: Mantas Mikulėnas <graw...@gmail.com> Fixes: 002d8a1a6c11 ("net: skip genenerating uevents for network namespaces that are exiting") Signed-off-by: Andrei Vagin <ava...@openvz.org> --- net/core/net-sysfs.c | 6 +++--- 1 file

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 <ava...@gmail.com> 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 > >

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 <ebied...@xmission.com> wrote: > Andrei Vagin <ava...@gmail.com> writes: > >> Hello, >> >> We run CRIU tests on linus' tree and today we found this issue. >> >> CRIU tests are the set of small prog

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 <ava...@gmail.com> writes: > > > On Thu, Jun 29, 2017 at 12:06 PM, Eric W. Biederman > > <ebied...@xmission.com> wrote: > >> Andrei Vagin <ava...@gmail.com> writes: &g

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 <ava...@gmail.com> writes: > > > > > On Thu, Jun 29, 2017 at 12:06 PM, Eric W. Biederman > > > <ebied..

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

2017-05-17 Thread Andrei Vagin
. Miller <da...@davemloft.net> Fixes: 65101aeca522 ("net/sock: factor out dequeue/peek with offset cod") Signed-off-by: Andrei Vagin <ava...@openvz.org> --- net/core/datagram.c | 14 -- net/ipv4/udp.c | 12 +++- 2 files changed, 11 insertions(+), 15 d

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

2017-05-16 Thread Andrei Vagin
aeca522 ("net/sock: factor out dequeue/peek with offset cod") Signed-off-by: Andrei Vagin <ava...@openvz.org> --- 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..bc4611

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 > of i

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

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,

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

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 <ava...@gmail.com> wrot

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

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

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

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

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(

[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 <ava...@openvz.org> --- net/unix/diag.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/unix/diag.c b/net/unix/diag.c index 4d9679701a6d..384

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

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

[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 <ava...@openvz.org> --- 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

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 <ava...@virtuozzo.com> wrote: > > On Sat, May 05, 2018 at 10:59:02AM -0700, syzbot wrote: > >> Hello, > >> > >> syzbot found the following crash

Re: possible deadlock in sk_diag_fill

2018-05-15 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 <ava...@virtuozzo.com> wrote: > >> >> Hello, > >> >> > >> >> syzbot found the following crash on: > >> >&g

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 >

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

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 a

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

2018-05-16 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 [

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 account

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

2018-06-11 Thread Andrei Vagin
ce. > > 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 -0700 Subject: [PATCH] net

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

[PATCH] net: split sk_reuse into sk_reuse and sk_force_reuse

2018-06-13 Thread Andrei Vagin
ockets") 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 a/include/net/

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

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

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

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 <ava...@virtuozzo.com> wrote: > >> > Hello, > >> > > >> > syzkaller hit the following crash on > >> > 75aa5540627fdb3d8f86229776ea

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

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

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

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

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

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: 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
] netlink_unicast+0x4be/0x6a0 net/netlink/af_netlink.c:1334 netlink_sendmsg+0xa4a/0xe60 net/netlink/af_netlink.c:1897 Cc: Jiri Benc <jb...@redhat.com> Fixes: 79e1ad148c84 ("rtnetlink: use netnsid to query interface") Signed-off-by: Andrei Vagin <ava...@openvz.org> --- net

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

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

2018-01-03 Thread Andrei Vagin
l.com Signed-off-by: Andrei Vagin <ava...@openvz.org> --- v2: add the Reported-by tag net/core/rtnetlink.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index dabba2a91fc8..778d7f03404a 100644 --- a/net/core/rtne

[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

[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(+)

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 [

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

2018-03-14 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] 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

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

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