[linux-yocto] [yocto-4.12][PATCH 0/9] fix three kinds of kmemleak

Liwei Song liwei.song at windriver.com
Tue Dec 19 01:47:45 PST 2017


Hi Bruce,

These patches used to fix three kinds of kmemleak, all patches backport
from upstream.

kmemleak as following:

unreferenced object 0xffff9ad6eb164b40 (size 256):
  comm "rdate", pid 971, jiffies 4294953569 (age 39.383s)
  hex dump (first 32 bytes):
    01 00 00 00 00 00 00 00 08 00 dd 9a ff ff ff ff ................
    77 ce 01 00 00 00 00 00 d8 39 9f f0 d6 9a ff ff w........9......
  backtrace:
    [<ffffffff9b761308>] kmemleak_alloc+0x28/0x50
    [<ffffffff9ae0f538>] kmem_cache_alloc+0xf8/0x1f0
    [<ffffffffc008ee6d>] __nf_conntrack_alloc.isra.9+0x4d/0x180 [nf_conntrack]
    [<ffffffffc008f018>] init_conntrack+0x58/0x2c0 [nf_conntrack]
    [<ffffffffc008f554>] nf_conntrack_in+0x2d4/0x340 [nf_conntrack]
    [<ffffffffc00a863f>] ipv4_conntrack_local+0x4f/0x60 [nf_conntrack_ipv4]
    [<ffffffff9b62f23a>] nf_hook_slow+0x2a/0xa0
    [<ffffffff9b63c170>] __ip_local_out+0xc0/0xd0
    [<ffffffff9b63c19c>] ip_local_out+0x1c/0x40
    [<ffffffff9b63c4cd>] ip_queue_xmit+0x15d/0x3e0
    [<ffffffff9b654397>] tcp_transmit_skb+0x5c7/0x910
    [<ffffffff9b655d66>] tcp_connect+0x6e6/0x7b0
    [<ffffffff9b658f3b>] tcp_v4_connect+0x3bb/0x4b0
    [<ffffffff9b670941>] __inet_stream_connect+0x211/0x320
    [<ffffffff9b670a8b>] inet_stream_connect+0x3b/0x60
    [<ffffffff9b5d859e>] SyS_connect+0x6e/0xd0 

unreferenced object 0xffffa0f9e0aedc00 (size 1024):
  comm "(ostnamed)", pid 853, jiffies 4294674870 (age 4032.187s)
  hex dump (first 32 bytes):
    f8 c0 06 c0 ff ff ff ff 68 8f c1 d8 f9 a0 ff ff  ........h.......
    04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff91cae758>] kmemleak_alloc+0x28/0x50
    [<ffffffff9140c9e1>] __kmalloc_track_caller+0x121/0x260
    [<ffffffff913c8e80>] kmemdup+0x20/0x50
    [<ffffffffc00685ec>] dccp_init_net+0x8c/0x170 [nf_conntrack]
    [<ffffffffc0064ad5>] nf_ct_l4proto_pernet_register_one+0x25/0x70 [nf_conntrack]
    [<ffffffffc0064b67>] nf_ct_l4proto_pernet_register+0x47/0xc0 [nf_conntrack]
    [<ffffffffc0095690>] ipv4_net_init+0x20/0x70 [nf_conntrack_ipv4]
    [<ffffffff91b35fb1>] ops_init+0xa1/0x130
    [<ffffffff91b36a0b>] setup_net+0x8b/0x130
    [<ffffffff91b3719a>] copy_net_ns+0xba/0x1c0
    [<ffffffff912d598f>] create_new_namespaces+0x11f/0x1e0
    [<ffffffff912d5c0a>] unshare_nsproxy_namespaces+0x5a/0xb0
    [<ffffffff912b6873>] SyS_unshare+0x193/0x320
    [<ffffffff91cb4c60>] entry_SYSCALL_64_fastpath+0x13/0x94
    [<ffffffffffffffff>] 0xffffffffffffffff

unreferenced object 0xffffab1c02178000 (size 16384):
  comm "postfix-script", pid 826, jiffies 4294675099 (age 66.129s)
  hex dump (first 32 bytes):
    9d 6e ac 57 00 00 00 00 00 00 00 00 00 00 00 00  .n.W............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffffaeeae758>] kmemleak_alloc+0x28/0x50
    [<ffffffffae5ef33b>] __vmalloc_node_range+0x1ab/0x290
    [<ffffffffae4b4ca0>] copy_process.part.42+0x690/0x1a70
    [<ffffffffae4b6271>] _do_fork+0xe1/0x390
    [<ffffffffae4b65c9>] SyS_clone+0x19/0x20
    [<ffffffffae40285d>] do_syscall_64+0x4d/0xb0
    [<ffffffffaeeb4d06>] return_from_SYSCALL_64+0x0/0x6a
    [<ffffffffffffffff>] 0xffffffffffffffff


Catalin Marinas (3):
  mm: kmemleak: slightly reduce the size of some structures on 64-bit
    architectures
  mm: kmemleak: factor object reference updating out of scan_block()
  mm: kmemleak: treat vm_struct as alternative reference to vmalloc'ed
    objects

Florian Westphal (5):
  netfilter: conntrack: rename nf_ct_iterate_cleanup
  netfilter: conntrack: don't call iter for non-confirmed conntracks
  netfilter: conntrack: add nf_ct_iterate_destroy
  netfilter: move table iteration out of netns exit paths
  netfilter: conntrack: do not enable connection tracking unless needed

Liping Zhang (1):
  netfilter: nf_ct_dccp/sctp: fix memory leak after netns cleanup

 Documentation/dev-tools/kmemleak.rst             |   1 +
 Documentation/networking/nf_conntrack-sysctl.txt |  11 --
 include/linux/kmemleak.h                         |   7 ++
 include/net/netfilter/nf_conntrack.h             |  10 +-
 include/net/netfilter/nf_conntrack_l3proto.h     |  15 ---
 mm/kmemleak.c                                    | 136 +++++++++++++++++++----
 mm/vmalloc.c                                     |   7 +-
 net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c   |  16 +--
 net/ipv4/netfilter/nf_nat_masquerade_ipv4.c      |   4 +-
 net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c   |  17 +--
 net/ipv6/netfilter/nf_nat_masquerade_ipv6.c      |  10 +-
 net/netfilter/nf_conntrack_core.c                | 132 +++++++++++++++++-----
 net/netfilter/nf_conntrack_netlink.c             |   4 +-
 net/netfilter/nf_conntrack_proto.c               |  55 +++------
 net/netfilter/nf_conntrack_proto_dccp.c          |   7 ++
 net/netfilter/nf_conntrack_proto_sctp.c          |   7 ++
 net/netfilter/nf_conntrack_standalone.c          |  10 --
 net/netfilter/nf_nat_core.c                      |   6 +-
 18 files changed, 283 insertions(+), 172 deletions(-)

-- 
2.7.4



More information about the linux-yocto mailing list