lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CH2PR15MB3575EDA28674D0E5CC67EF5B9A130@CH2PR15MB3575.namprd15.prod.outlook.com>
Date:   Mon, 10 Jun 2019 11:57:52 +0000
From:   Jon Maloy <jon.maloy@...csson.com>
To:     Xin Long <lucien.xin@...il.com>,
        syzbot <syzbot+78fbe679c8ca8d264a8d@...kaller.appspotmail.com>
CC:     davem <davem@...emloft.net>, LKML <linux-kernel@...r.kernel.org>,
        network dev <netdev@...r.kernel.org>,
        syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
        "tipc-discussion@...ts.sourceforge.net" 
        <tipc-discussion@...ts.sourceforge.net>,
        Ying Xue <ying.xue@...driver.com>
Subject: RE: memory leak in tipc_buf_acquire



> -----Original Message-----
> From: netdev-owner@...r.kernel.org <netdev-owner@...r.kernel.org> On
> Behalf Of Xin Long
> Sent: 9-Jun-19 14:45
> To: syzbot <syzbot+78fbe679c8ca8d264a8d@...kaller.appspotmail.com>
> Cc: davem <davem@...emloft.net>; Jon Maloy <jon.maloy@...csson.com>;
> LKML <linux-kernel@...r.kernel.org>; network dev
> <netdev@...r.kernel.org>; syzkaller-bugs <syzkaller-
> bugs@...glegroups.com>; tipc-discussion@...ts.sourceforge.net; Ying Xue
> <ying.xue@...driver.com>
> Subject: Re: memory leak in tipc_buf_acquire
> 
> On Sat, May 25, 2019 at 5:18 AM syzbot
> <syzbot+78fbe679c8ca8d264a8d@...kaller.appspotmail.com> wrote:
> >
> > Hello,
> >
> > syzbot found the following crash on:
> >
> > HEAD commit:    4dde821e Merge tag 'xfs-5.2-fixes-1' of git://git.kernel.o..
> > git tree:       upstream
> > console output:
> > https://protect2.fireeye.com/url?k=2a9bdca3-761109b5-2a9b9c38-
> 862f14a9
> > 365e-
> 4ed8fb52eb782aab&q=1&u=https%3A%2F%2Fsyzkaller.appspot.com%2Fx%
> 2F
> > log.txt%3Fx%3D107db73aa00000 kernel config:
> > https://protect2.fireeye.com/url?k=a1863015-fd0ce503-a186708e-
> 862f14a9
> > 365e-
> 04056f2111354660&q=1&u=https%3A%2F%2Fsyzkaller.appspot.com%2Fx%
> 2F
> > .config%3Fx%3D61dd9e15a761691d dashboard link:
> > https://protect2.fireeye.com/url?k=ba923b23-e618ee35-ba927bb8-
> 862f14a9365e-
> 6187e2f343fe3a3e&q=1&u=https%3A%2F%2Fsyzkaller.appspot.com%2Fbug
> %3Fextid%3D78fbe679c8ca8d264a8d
> > compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
> > syz repro:      https://protect2.fireeye.com/url?k=27ea1a58-7b60cf4e-
> 27ea5ac3-862f14a9365e-
> f17f13fb7f100fa1&q=1&u=https%3A%2F%2Fsyzkaller.appspot.com%2Fx%2
> Frepro.syz%3Fx%3D162bd84ca00000
> > C reproducer:   https://protect2.fireeye.com/url?k=dbe4799b-876eac8d-
> dbe43900-862f14a9365e-
> 787a755a5a1800d6&q=1&u=https%3A%2F%2Fsyzkaller.appspot.com%2Fx
> %2Frepro.c%3Fx%3D160c605ca00000
> >
> Looks we need to purge each member's deferredq list in tipc_group_delete():
> diff --git a/net/tipc/group.c b/net/tipc/group.c index 992be61..23823eb
> 100644
> --- a/net/tipc/group.c
> +++ b/net/tipc/group.c
> @@ -218,6 +218,7 @@ void tipc_group_delete(struct net *net, struct
> tipc_group *grp)
> 
>   rbtree_postorder_for_each_entry_safe(m, tmp, tree, tree_node) {
>   tipc_group_proto_xmit(grp, m, GRP_LEAVE_MSG, &xmitq);
> + __skb_queue_purge(&m->deferredq);
>   list_del(&m->list);
>   kfree(m);
>   }

Yes, I think you are right. I'll check it further.

Thanks
///jon

> 
> > IMPORTANT: if you fix the bug, please add the following tag to the commit:
> > Reported-by: syzbot+78fbe679c8ca8d264a8d@...kaller.appspotmail.com
> >
> > type=1400 audit(1558701681.775:36): avc:  denied  { map } for
> > pid=7128 comm="syz-executor987" path="/root/syz-executor987656147"
> dev="sda1"
> > ino=15900 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
> > tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
> > executing program executing program executing program executing
> > program
> > BUG: memory leak
> > unreferenced object 0xffff88810df83c00 (size 512):
> >    comm "softirq", pid 0, jiffies 4294942354 (age 19.830s)
> >    hex dump (first 32 bytes):
> >      38 1a 0d 0f 81 88 ff ff 38 1a 0d 0f 81 88 ff ff  8.......8.......
> >      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> >    backtrace:
> >      [<000000009375ee42>] kmemleak_alloc_recursive
> > include/linux/kmemleak.h:55 [inline]
> >      [<000000009375ee42>] slab_post_alloc_hook mm/slab.h:439 [inline]
> >      [<000000009375ee42>] slab_alloc_node mm/slab.c:3269 [inline]
> >      [<000000009375ee42>] kmem_cache_alloc_node+0x153/0x2a0
> mm/slab.c:3579
> >      [<000000004c563922>] __alloc_skb+0x6e/0x210 net/core/skbuff.c:198
> >      [<00000000ec87bfa1>] alloc_skb_fclone include/linux/skbuff.h:1107
> > [inline]
> >      [<00000000ec87bfa1>] tipc_buf_acquire+0x2f/0x80 net/tipc/msg.c:66
> >      [<00000000d151ef84>] tipc_msg_create+0x37/0xe0 net/tipc/msg.c:98
> >      [<000000008bb437b0>] tipc_group_create_event+0xb3/0x1b0
> > net/tipc/group.c:679
> >      [<00000000947b1d0f>] tipc_group_proto_rcv+0x569/0x640
> > net/tipc/group.c:781
> >      [<00000000b75ab039>] tipc_sk_proto_rcv net/tipc/socket.c:1996
> [inline]
> >      [<00000000b75ab039>] tipc_sk_filter_rcv+0x9ac/0xf20
> > net/tipc/socket.c:2163
> >      [<000000000dab7a6c>] tipc_sk_enqueue net/tipc/socket.c:2255 [inline]
> >      [<000000000dab7a6c>] tipc_sk_rcv+0x494/0x8a0
> net/tipc/socket.c:2306
> >      [<00000000023a7ddd>] tipc_node_xmit+0x196/0x1f0
> net/tipc/node.c:1442
> >      [<00000000337dd9eb>] tipc_node_xmit_skb net/tipc/node.c:1491
> [inline]
> >      [<00000000337dd9eb>] tipc_node_distr_xmit+0x7d/0x120
> > net/tipc/node.c:1506
> >      [<00000000b6375182>] tipc_group_delete+0xe6/0x130
> net/tipc/group.c:224
> >      [<000000000361ba2b>] tipc_sk_leave+0x57/0xb0
> net/tipc/socket.c:2925
> >      [<000000009df90505>] tipc_release+0x7b/0x5e0 net/tipc/socket.c:584
> >      [<000000009f3189da>] __sock_release+0x4b/0xe0 net/socket.c:607
> >      [<00000000d3568ee0>] sock_close+0x1b/0x30 net/socket.c:1279
> >      [<00000000266a6215>] __fput+0xed/0x300 fs/file_table.c:280
> >
> > BUG: memory leak
> > unreferenced object 0xffff888111895400 (size 1024):
> >    comm "softirq", pid 0, jiffies 4294942354 (age 19.830s)
> >    hex dump (first 32 bytes):
> >      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> >      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> >    backtrace:
> >      [<00000000e2e2855e>] kmemleak_alloc_recursive
> > include/linux/kmemleak.h:55 [inline]
> >      [<00000000e2e2855e>] slab_post_alloc_hook mm/slab.h:439 [inline]
> >      [<00000000e2e2855e>] slab_alloc_node mm/slab.c:3269 [inline]
> >      [<00000000e2e2855e>] kmem_cache_alloc_node_trace+0x15b/0x2a0
> > mm/slab.c:3597
> >      [<00000000a5030ce7>] __do_kmalloc_node mm/slab.c:3619 [inline]
> >      [<00000000a5030ce7>] __kmalloc_node_track_caller+0x38/0x50
> > mm/slab.c:3634
> >      [<0000000039212451>] __kmalloc_reserve.isra.0+0x40/0xb0
> > net/core/skbuff.c:142
> >      [<00000000307cb4cf>] __alloc_skb+0xa0/0x210 net/core/skbuff.c:210
> >      [<00000000ec87bfa1>] alloc_skb_fclone include/linux/skbuff.h:1107
> > [inline]
> >      [<00000000ec87bfa1>] tipc_buf_acquire+0x2f/0x80 net/tipc/msg.c:66
> >      [<00000000d151ef84>] tipc_msg_create+0x37/0xe0 net/tipc/msg.c:98
> >      [<000000008bb437b0>] tipc_group_create_event+0xb3/0x1b0
> > net/tipc/group.c:679
> >      [<00000000947b1d0f>] tipc_group_proto_rcv+0x569/0x640
> > net/tipc/group.c:781
> >      [<00000000b75ab039>] tipc_sk_proto_rcv net/tipc/socket.c:1996
> [inline]
> >      [<00000000b75ab039>] tipc_sk_filter_rcv+0x9ac/0xf20
> > net/tipc/socket.c:2163
> >      [<000000000dab7a6c>] tipc_sk_enqueue net/tipc/socket.c:2255 [inline]
> >      [<000000000dab7a6c>] tipc_sk_rcv+0x494/0x8a0
> net/tipc/socket.c:2306
> >      [<00000000023a7ddd>] tipc_node_xmit+0x196/0x1f0
> net/tipc/node.c:1442
> >      [<00000000337dd9eb>] tipc_node_xmit_skb net/tipc/node.c:1491
> [inline]
> >      [<00000000337dd9eb>] tipc_node_distr_xmit+0x7d/0x120
> > net/tipc/node.c:1506
> >      [<00000000b6375182>] tipc_group_delete+0xe6/0x130
> net/tipc/group.c:224
> >      [<000000000361ba2b>] tipc_sk_leave+0x57/0xb0
> net/tipc/socket.c:2925
> >      [<000000009df90505>] tipc_release+0x7b/0x5e0 net/tipc/socket.c:584
> >      [<000000009f3189da>] __sock_release+0x4b/0xe0 net/socket.c:607
> >
> > BUG: memory leak
> > unreferenced object 0xffff88810e63de00 (size 512):
> >    comm "softirq", pid 0, jiffies 4294943548 (age 7.890s)
> >    hex dump (first 32 bytes):
> >      38 10 0d 0f 81 88 ff ff 38 10 0d 0f 81 88 ff ff  8.......8.......
> >      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
> >    backtrace:
> >      [<000000009375ee42>] kmemleak_alloc_recursive
> > include/linux/kmemleak.h:55 [inline]
> >      [<000000009375ee42>] slab_post_alloc_hook mm/slab.h:439 [inline]
> >      [<000000009375ee42>] slab_alloc_node mm/slab.c:3269 [inline]
> >      [<000000009375ee42>] kmem_cache_alloc_node+0x153/0x2a0
> mm/slab.c:3579
> >      [<000000004c563922>] __alloc_skb+0x6e/0x210 net/core/skbuff.c:198
> >      [<00000000ec87bfa1>] alloc_skb_fclone include/linux/skbuff.h:1107
> > [inline]
> >      [<00000000ec87bfa1>] tipc_buf_acquire+0x2f/0x80 net/tipc/msg.c:66
> >      [<00000000d151ef84>] tipc_msg_create+0x37/0xe0 net/tipc/msg.c:98
> >      [<000000008bb437b0>] tipc_group_create_event+0xb3/0x1b0
> > net/tipc/group.c:679
> >      [<00000000947b1d0f>] tipc_group_proto_rcv+0x569/0x640
> > net/tipc/group.c:781
> >      [<00000000b75ab039>] tipc_sk_proto_rcv net/tipc/socket.c:1996
> [inline]
> >      [<00000000b75ab039>] tipc_sk_filter_rcv+0x9ac/0xf20
> > net/tipc/socket.c:2163
> >      [<000000000dab7a6c>] tipc_sk_enqueue net/tipc/socket.c:2255 [inline]
> >      [<000000000dab7a6c>] tipc_sk_rcv+0x494/0x8a0
> net/tipc/socket.c:2306
> >      [<00000000023a7ddd>] tipc_node_xmit+0x196/0x1f0
> net/tipc/node.c:1442
> >      [<00000000337dd9eb>] tipc_node_xmit_skb net/tipc/node.c:1491
> [inline]
> >      [<00000000337dd9eb>] tipc_node_distr_xmit+0x7d/0x120
> > net/tipc/node.c:1506
> >      [<00000000b6375182>] tipc_group_delete+0xe6/0x130
> net/tipc/group.c:224
> >      [<000000000361ba2b>] tipc_sk_leave+0x57/0xb0
> net/tipc/socket.c:2925
> >      [<000000009df90505>] tipc_release+0x7b/0x5e0 net/tipc/socket.c:584
> >      [<000000009f3189da>] __sock_release+0x4b/0xe0 net/socket.c:607
> >      [<00000000d3568ee0>] sock_close+0x1b/0x30 net/socket.c:1279
> >      [<00000000266a6215>] __fput+0xed/0x300 fs/file_table.c:280
> >
> >
> >
> > ---
> > This bug is generated by a bot. It may contain errors.
> > See https://protect2.fireeye.com/url?k=6424a141-38ae7457-6424e1da-
> 862f14a9365e-
> 29d28d4e37c9de97&q=1&u=https%3A%2F%2Fgoo.gl%2FtpsmEJ for more
> information about syzbot.
> > syzbot engineers can be reached at syzkaller@...glegroups.com.
> >
> > syzbot will keep track of this bug report. See:
> > https://protect2.fireeye.com/url?k=e3266fe7-bfacbaf1-e3262f7c-
> 862f14a9365e-
> 80a14dc097f61dfe&q=1&u=https%3A%2F%2Fgoo.gl%2FtpsmEJ%23status
> for how to communicate with syzbot.
> > syzbot can test patches for this bug, for details see:
> > https://protect2.fireeye.com/url?k=26e2f1e8-7a6824fe-26e2b173-
> 862f14a9
> > 365e-
> e569ee98f89625d4&q=1&u=https%3A%2F%2Fgoo.gl%2FtpsmEJ%23testing-
> pa
> > tches

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ