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] [day] [month] [year] [list]
Date:   Fri, 26 Aug 2022 10:58:11 -0700
From:   Eric Dumazet <edumazet@...gle.com>
To:     Jiri Olsa <olsajiri@...il.com>
Cc:     netdev <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jakub Kicinski <kuba@...nel.org>
Subject: Re: memory leaks after running bpf selftests

On Fri, Aug 26, 2022 at 10:50 AM Jiri Olsa <olsajiri@...il.com> wrote:
>
> hi,
> I'm getting memory leaks report after running test_progs,
> on latest bpf-next/master, looks networking related
>
> jirka
>
>
> ---
> unreferenced object 0xffff888102b816c0 (size 232):
>   comm "(ostnamed)", pid 534, jiffies 4294672162 (age 704.879s)
>   hex dump (first 32 bytes):
>     18 17 3c 19 81 88 ff ff c0 0a b8 02 81 88 ff ff  ..<.............
>     00 c0 a6 1c 81 88 ff ff 00 00 00 00 00 00 00 00  ................
>   backtrace:
>     [<ffffffff81c2c45e>] napi_skb_cache_get+0x4e/0x60
>     [<ffffffff81c2c532>] __alloc_skb+0x52/0x1c0
>     [<ffffffff81c2c6db>] __napi_alloc_skb+0x3b/0xe0
>     [<ffffffff81c8af09>] napi_get_frags+0x29/0x50

This is a bit strange, because napi_get_frags_check() seems very self-contained
with no obvious leak...

>     [<ffffffff81c4e3e5>] netif_napi_add_weight+0x135/0x280
>     [<ffffffff81cbc22a>] gro_cells_init+0x8a/0xe0
>     [<ffffffff81ed8960>] ip6_tnl_dev_init+0xe0/0x1b0
>     [<ffffffff81c567ea>] register_netdevice+0x19a/0x6b0
>     [<ffffffff81c56d1a>] register_netdev+0x1a/0x30
>     [<ffffffff81eda4b2>] ip6_tnl_init_net+0x1c2/0x440
>     [<ffffffff81c3b678>] ops_init+0x38/0x160
>     [<ffffffff81c3c1cf>] setup_net+0x17f/0x340
>     [<ffffffff81c3dd7c>] copy_net_ns+0x10c/0x270
>     [<ffffffff81181a67>] create_new_namespaces+0x117/0x300
>     [<ffffffff811820a5>] unshare_nsproxy_namespaces+0x55/0xb0
>     [<ffffffff8114e1bc>] ksys_unshare+0x19c/0x3b0
> unreferenced object 0xffff888102b80ac0 (size 232):
>   comm "(ostnamed)", pid 534, jiffies 4294672162 (age 704.879s)
>   hex dump (first 32 bytes):
>     c0 16 b8 02 81 88 ff ff 40 00 b8 02 81 88 ff ff  ........@.......
>     00 c0 a6 1c 81 88 ff ff 00 00 00 00 00 00 00 00  ................
>   backtrace:
>     [<ffffffff81c2c45e>] napi_skb_cache_get+0x4e/0x60
>     [<ffffffff81c2c532>] __alloc_skb+0x52/0x1c0
>     [<ffffffff81c2c6db>] __napi_alloc_skb+0x3b/0xe0
>     [<ffffffff81c8af09>] napi_get_frags+0x29/0x50
>     [<ffffffff81c4e3e5>] netif_napi_add_weight+0x135/0x280
>     [<ffffffff81cbc22a>] gro_cells_init+0x8a/0xe0
>     [<ffffffff81ed8960>] ip6_tnl_dev_init+0xe0/0x1b0
>     [<ffffffff81c567ea>] register_netdevice+0x19a/0x6b0
>     [<ffffffff81c56d1a>] register_netdev+0x1a/0x30
>     [<ffffffff81eda4b2>] ip6_tnl_init_net+0x1c2/0x440
>     [<ffffffff81c3b678>] ops_init+0x38/0x160
>     [<ffffffff81c3c1cf>] setup_net+0x17f/0x340
>     [<ffffffff81c3dd7c>] copy_net_ns+0x10c/0x270
>     [<ffffffff81181a67>] create_new_namespaces+0x117/0x300
>     [<ffffffff811820a5>] unshare_nsproxy_namespaces+0x55/0xb0
>     [<ffffffff8114e1bc>] ksys_unshare+0x19c/0x3b0
> unreferenced object 0xffff888102b80040 (size 232):
>   comm "(ostnamed)", pid 534, jiffies 4294672162 (age 704.879s)
>   hex dump (first 32 bytes):
>     c0 0a b8 02 81 88 ff ff c0 0d b8 02 81 88 ff ff  ................
>     00 c0 a6 1c 81 88 ff ff 00 00 00 00 00 00 00 00  ................
>   backtrace:
>     [<ffffffff81c2c45e>] napi_skb_cache_get+0x4e/0x60
>     [<ffffffff81c2c532>] __alloc_skb+0x52/0x1c0
>     [<ffffffff81c2c6db>] __napi_alloc_skb+0x3b/0xe0
>     [<ffffffff81c8af09>] napi_get_frags+0x29/0x50
>     [<ffffffff81c4e3e5>] netif_napi_add_weight+0x135/0x280
>     [<ffffffff81cbc22a>] gro_cells_init+0x8a/0xe0
>     [<ffffffff81ed8960>] ip6_tnl_dev_init+0xe0/0x1b0
>     [<ffffffff81c567ea>] register_netdevice+0x19a/0x6b0
>     [<ffffffff81c56d1a>] register_netdev+0x1a/0x30
>     [<ffffffff81eda4b2>] ip6_tnl_init_net+0x1c2/0x440
>     [<ffffffff81c3b678>] ops_init+0x38/0x160
>     [<ffffffff81c3c1cf>] setup_net+0x17f/0x340
>     [<ffffffff81c3dd7c>] copy_net_ns+0x10c/0x270
>     [<ffffffff81181a67>] create_new_namespaces+0x117/0x300
>     [<ffffffff811820a5>] unshare_nsproxy_namespaces+0x55/0xb0
>     [<ffffffff8114e1bc>] ksys_unshare+0x19c/0x3b0
> unreferenced object 0xffff888102b80dc0 (size 232):
>   comm "(ostnamed)", pid 534, jiffies 4294672162 (age 704.893s)
>   hex dump (first 32 bytes):
>     40 00 b8 02 81 88 ff ff 18 17 3c 19 81 88 ff ff  @.........<.....
>     00 c0 a6 1c 81 88 ff ff 00 00 00 00 00 00 00 00  ................
>   backtrace:
>     [<ffffffff81c2c45e>] napi_skb_cache_get+0x4e/0x60
>     [<ffffffff81c2c532>] __alloc_skb+0x52/0x1c0
>     [<ffffffff81c2c6db>] __napi_alloc_skb+0x3b/0xe0
>     [<ffffffff81c8af09>] napi_get_frags+0x29/0x50
>     [<ffffffff81c4e3e5>] netif_napi_add_weight+0x135/0x280
>     [<ffffffff81cbc22a>] gro_cells_init+0x8a/0xe0
>     [<ffffffff81ed8960>] ip6_tnl_dev_init+0xe0/0x1b0
>     [<ffffffff81c567ea>] register_netdevice+0x19a/0x6b0
>     [<ffffffff81c56d1a>] register_netdev+0x1a/0x30
>     [<ffffffff81eda4b2>] ip6_tnl_init_net+0x1c2/0x440
>     [<ffffffff81c3b678>] ops_init+0x38/0x160
>     [<ffffffff81c3c1cf>] setup_net+0x17f/0x340
>     [<ffffffff81c3dd7c>] copy_net_ns+0x10c/0x270
>     [<ffffffff81181a67>] create_new_namespaces+0x117/0x300
>     [<ffffffff811820a5>] unshare_nsproxy_namespaces+0x55/0xb0
>     [<ffffffff8114e1bc>] ksys_unshare+0x19c/0x3b0
> unreferenced object 0xffff88812c3a3400 (size 1024):
>   comm "test_progs", pid 686, jiffies 4294713342 (age 663.722s)
>   hex dump (first 32 bytes):
>     6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
>     6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
>   backtrace:
>     [<ffffffff81c2c566>] __alloc_skb+0x86/0x1c0
>     [<ffffffff81c2c6db>] __napi_alloc_skb+0x3b/0xe0
>     [<ffffffff81c8af09>] napi_get_frags+0x29/0x50
>     [<ffffffff81a0a952>] tun_get_user+0x242/0x1250
>     [<ffffffff81a0c2c0>] tun_chr_write_iter+0x50/0x90
>     [<ffffffff81436faf>] do_iter_readv_writev+0xdf/0x140
>     [<ffffffff81438fc4>] do_iter_write+0x84/0x1d0
>     [<ffffffff81439205>] vfs_writev+0xc5/0x290
>     [<ffffffff8143944f>] do_writev+0x7f/0x160
>     [<ffffffff81fbd157>] do_syscall_64+0x37/0x90
>     [<ffffffff8200009b>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
> unreferenced object 0xffff88812c3a4000 (size 1024):
>   comm "test_progs", pid 686, jiffies 4294713342 (age 663.722s)
>   hex dump (first 32 bytes):
>     6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
>     6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
>   backtrace:
>     [<ffffffff81c2c566>] __alloc_skb+0x86/0x1c0
>     [<ffffffff81c2c6db>] __napi_alloc_skb+0x3b/0xe0
>     [<ffffffff81c8af09>] napi_get_frags+0x29/0x50
>     [<ffffffff81a0a952>] tun_get_user+0x242/0x1250
>     [<ffffffff81a0c2c0>] tun_chr_write_iter+0x50/0x90
>     [<ffffffff81436faf>] do_iter_readv_writev+0xdf/0x140
>     [<ffffffff81438fc4>] do_iter_write+0x84/0x1d0
>     [<ffffffff81439205>] vfs_writev+0xc5/0x290
>     [<ffffffff8143944f>] do_writev+0x7f/0x160
>     [<ffffffff81fbd157>] do_syscall_64+0x37/0x90
>     [<ffffffff8200009b>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
> unreferenced object 0xffff88812c3a1000 (size 1024):
>   comm "test_progs", pid 686, jiffies 4294713342 (age 663.722s)
>   hex dump (first 32 bytes):
>     6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
>     6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
>   backtrace:
>     [<ffffffff81c2c566>] __alloc_skb+0x86/0x1c0
>     [<ffffffff81c2c6db>] __napi_alloc_skb+0x3b/0xe0
>     [<ffffffff81c8af09>] napi_get_frags+0x29/0x50
>     [<ffffffff81a0a952>] tun_get_user+0x242/0x1250
>     [<ffffffff81a0c2c0>] tun_chr_write_iter+0x50/0x90
>     [<ffffffff81436faf>] do_iter_readv_writev+0xdf/0x140
>     [<ffffffff81438fc4>] do_iter_write+0x84/0x1d0
>     [<ffffffff81439205>] vfs_writev+0xc5/0x290
>     [<ffffffff8143944f>] do_writev+0x7f/0x160
>     [<ffffffff81fbd157>] do_syscall_64+0x37/0x90
>     [<ffffffff8200009b>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
> unreferenced object 0xffff88812c3a1c00 (size 1024):
>   comm "test_progs", pid 686, jiffies 4294713342 (age 663.741s)
>   hex dump (first 32 bytes):
>     6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
>     6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
>   backtrace:
>     [<ffffffff81c2c566>] __alloc_skb+0x86/0x1c0
>     [<ffffffff81c2c6db>] __napi_alloc_skb+0x3b/0xe0
>     [<ffffffff81c8af09>] napi_get_frags+0x29/0x50
>     [<ffffffff81a0a952>] tun_get_user+0x242/0x1250
>     [<ffffffff81a0c2c0>] tun_chr_write_iter+0x50/0x90
>     [<ffffffff81436faf>] do_iter_readv_writev+0xdf/0x140
>     [<ffffffff81438fc4>] do_iter_write+0x84/0x1d0
>     [<ffffffff81439205>] vfs_writev+0xc5/0x290
>     [<ffffffff8143944f>] do_writev+0x7f/0x160
>     [<ffffffff81fbd157>] do_syscall_64+0x37/0x90
>     [<ffffffff8200009b>] entry_SYSCALL_64_after_hwframe+0x63/0xcd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ