From: Cong Wang <xiyou.wangcong@gmail.com>
To: Jakub Kicinski <kubakici@wp.pl>
Cc: "Johannes Berg" <johannes@sipsolutions.net>,
"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
"Maciej Żenczykowski" <zenczykowski@gmail.com>,
"Linux Kernel Network Developers" <netdev@vger.kernel.org>
Subject: Re: new kmemleak reports (was: Re: [PATCH 0/5] genetlink improvements)
Date: Wed, 2 Nov 2016 13:30:34 -0700 [thread overview]
Message-ID: <CAM_iQpV_0gyrJC0U6Qk9VSSaNOphe_0tq5o2kt8-r0UybLU5FA@mail.gmail.com> (raw)
In-Reply-To: <20161101185630.3c7d326f@jkicinski-Precision-T1700>
On Tue, Nov 1, 2016 at 11:56 AM, Jakub Kicinski <kubakici@wp.pl> wrote:
> On Tue, 1 Nov 2016 11:32:52 -0700, Cong Wang wrote:
>> On Tue, Nov 1, 2016 at 10:28 AM, Jakub Kicinski <kubakici@wp.pl> wrote:
>> > unreferenced object 0xffff8807389cba28 (size 128):
>> > comm "swapper/0", pid 1, jiffies 4294898463 (age 781.332s)
>> > 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:
>> > [<ffffffff85decad8>] kmemleak_alloc+0x28/0x50
>> > [<ffffffff84771246>] __kmalloc+0x206/0x5a0
>> > [<ffffffff859e1261>] genl_register_family+0x711/0x11d0
>> > [<ffffffff888d9524>] netlbl_mgmt_genl_init+0x10/0x12
>> > [<ffffffff888d91e8>] netlbl_netlink_init+0x9/0x26
>> > [<ffffffff888d9254>] netlbl_init+0x4f/0x85
>> > [<ffffffff840022b7>] do_one_initcall+0xb7/0x2a0
>> > [<ffffffff887f9102>] kernel_init_freeable+0x597/0x636
>> > [<ffffffff85de7793>] kernel_init+0x13/0x140
>> > [<ffffffff85e0246a>] ret_from_fork+0x2a/0x40
>>
>> Looks like we are missing a kfree(family->attrbuf); on error path,
>> but it is not related to Johannes' recent patches.
>>
>> Could the attached patch help?
>>
>> Thanks.
>
> Still there:
>
> unreferenced object 0xffff88073fb204e8 (size 64):
> comm "swapper/0", pid 1, jiffies 4294898455 (age 88.528s)
> 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:
> [<ffffffff93decbf8>] kmemleak_alloc+0x28/0x50
> [<ffffffff92771246>] __kmalloc+0x206/0x5a0
> [<ffffffff939e1471>] genl_register_family+0x921/0x1270
> [<ffffffff968d0ecf>] genl_init+0x11/0x43
> [<ffffffff920022b7>] do_one_initcall+0xb7/0x2a0
> [<ffffffff967f9102>] kernel_init_freeable+0x597/0x636
> [<ffffffff93de78b3>] kernel_init+0x13/0x140
> [<ffffffff93e0256a>] ret_from_fork+0x2a/0x40
> [<ffffffffffffffff>] 0xffffffffffffffff
>
> etc.
Interesting, from the size it does look like we are leaking family->attrbuf,
but I don't see other cases could leak it except the error path I fixed.
Mind doing a quick bisect?
Thanks!
next prev parent reply other threads:[~2016-11-02 20:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 12:40 [PATCH 0/5] genetlink improvements Johannes Berg
2016-10-24 12:40 ` [PATCH 1/5] genetlink: introduce and use genl_family_attrbuf() Johannes Berg
2016-10-24 12:40 ` [PATCH 2/5] genetlink: no longer support using static family IDs Johannes Berg
2016-10-24 12:40 ` [PATCH 3/5] genetlink: statically initialize families Johannes Berg
2016-10-24 12:55 ` Johannes Berg
2016-10-25 11:25 ` David Laight
2016-10-25 11:38 ` Johannes Berg
2016-10-24 12:40 ` [PATCH 4/5] genetlink: use idr to track families Johannes Berg
2016-10-24 12:40 ` [PATCH 5/5] genetlink: mark families as __ro_after_init Johannes Berg
2016-10-27 20:16 ` [PATCH 0/5] genetlink improvements David Miller
2016-11-01 17:28 ` new kmemleak reports (was: Re: [PATCH 0/5] genetlink improvements) Jakub Kicinski
2016-11-01 18:32 ` Cong Wang
2016-11-01 18:56 ` Jakub Kicinski
2016-11-02 20:30 ` Cong Wang [this message]
2016-11-02 23:47 ` [RFC] make kmemleak scan __ro_after_init section " Jakub Kicinski
2016-11-03 5:40 ` Cong Wang
2016-11-03 15:48 ` Johannes Berg
2016-11-03 20:49 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAM_iQpV_0gyrJC0U6Qk9VSSaNOphe_0tq5o2kt8-r0UybLU5FA@mail.gmail.com \
--to=xiyou.wangcong@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=kubakici@wp.pl \
--cc=netdev@vger.kernel.org \
--cc=zenczykowski@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).