[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161215184630.mapjqzdox5aqmvsz@atomlin.usersys.redhat.com>
Date: Thu, 15 Dec 2016 18:46:30 +0000
From: Aaron Tomlin <atomlin@...hat.com>
To: "Luis R. Rodriguez" <mcgrof@...nel.org>
Cc: shuah@...nel.org, jeyu@...hat.com, rusty@...tcorp.com.au,
ebiederm@...ssion.com, dmitry.torokhov@...il.com, acme@...hat.com,
corbet@....net, martin.wilck@...e.com, mmarek@...e.com,
pmladek@...e.com, hare@...e.com, rwright@....com, jeffm@...e.com,
DSterba@...e.com, fdmanana@...e.com, neilb@...e.com,
linux@...ck-us.net, rgoldwyn@...e.com, subashab@...eaurora.org,
xypron.glpk@....de, keescook@...omium.org, mbenes@...e.cz,
paulmck@...ux.vnet.ibm.com, dan.j.williams@...el.com,
jpoimboe@...hat.com, davem@...emloft.net, mingo@...hat.com,
akpm@...ux-foundation.org, torvalds@...ux-foundation.org,
linux-kselftest@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC 02/10] module: fix memory leak on early load_module()
failures
On Thu 2016-12-08 11:48 -0800, Luis R. Rodriguez wrote:
> While looking for early possible module loading failures I was
> able to reproduce a memory leak possible with kmemleak. There
> are a few rare ways to trigger a failure:
>
> o we've run into a failure while processing kernel parameters
> (parse_args() returns an error)
> o mod_sysfs_setup() fails
> o we're a live patch module and copy_module_elf() fails
>
> Chances of running into this issue is really low.
>
> kmemleak splat:
>
> unreferenced object 0xffff9f2c4ada1b00 (size 32):
> comm "kworker/u16:4", pid 82, jiffies 4294897636 (age 681.816s)
> hex dump (first 32 bytes):
> 6d 65 6d 73 74 69 63 6b 30 00 00 00 00 00 00 00 memstick0.......
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> backtrace:
> [<ffffffff8c6cfeba>] kmemleak_alloc+0x4a/0xa0
> [<ffffffff8c200046>] __kmalloc_track_caller+0x126/0x230
> [<ffffffff8c1bc581>] kstrdup+0x31/0x60
> [<ffffffff8c1bc5d4>] kstrdup_const+0x24/0x30
> [<ffffffff8c3c23aa>] kvasprintf_const+0x7a/0x90
> [<ffffffff8c3b5481>] kobject_set_name_vargs+0x21/0x90
> [<ffffffff8c4fbdd7>] dev_set_name+0x47/0x50
> [<ffffffffc07819e5>] memstick_check+0x95/0x33c [memstick]
> [<ffffffff8c09c893>] process_one_work+0x1f3/0x4b0
> [<ffffffff8c09cb98>] worker_thread+0x48/0x4e0
> [<ffffffff8c0a2b79>] kthread+0xc9/0xe0
> [<ffffffff8c6dab5f>] ret_from_fork+0x1f/0x40
> [<ffffffffffffffff>] 0xffffffffffffffff
>
> Signed-off-by: Luis R. Rodriguez <mcgrof@...nel.org>
> ---
> kernel/module.c | 1 +
> 1 file changed, 1 insertion(+)
Reviewed-by: Aaron Tomlin <atomlin@...hat.com>
--
Aaron Tomlin
Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)
Powered by blists - more mailing lists