From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Maninder Singh <maninder1.s@samsung.com>,
jeyu@redhat.com, rusty@rustcorp.com.au,
akpm@linux-foundation.org, chris@chris-wilson.co.uk,
joonas.lahtinen@linux.intel.com, mhocko@suse.com,
keescook@chromium.org, jinb.park7@gmail.com, anisse@astier.eu,
rafael.j.wysocki@intel.com, zijun_hu@htc.com, mingo@kernel.org,
mawilcox@microsoft.com, thgarnie@google.com, joelaf@google.com,
kirill.shutemov@linux.intel.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, pankaj.m@samsung.com,
ajeet.y@samsung.com, hakbong5.lee@samsung.com,
a.sahrawat@samsung.com, lalit.mohan@samsung.com,
cpgs@samsung.com, Vaneet Narang <v.narang@samsung.com>
Subject: Re: [PATCH v2] module: check if memory leak by module.
Date: Thu, 30 Mar 2017 17:31:45 +0300 [thread overview]
Message-ID: <06383e49-148e-e31f-e66e-e50db7df470b@virtuozzo.com> (raw)
In-Reply-To: <20170330133712.GA23946@amd>
On 03/30/2017 04:37 PM, Pavel Machek wrote:
>
>> 3) This might produce false positives. E.g. module may defer vfree() in workqueue, so the
>> actual vfree() call happens after module unloaded.
>
> Umm. Really?
>
I should have been more specific. I meant vfree() called by module from the interrupt context.
In that case the actual __vunmap() will be deferred via schedule_work() thus it might happen
after the module unloaded.
See 32fcfd40715e ("make vfree() safe to call from interrupt contexts")
> I agree that module may alloc memory and pass it to someone else. Ok
> so far.
>
Right. In the case with vfree() from interrupt we actually pass the memory to
the core code to free it later.
> But if module code executes after module is unloaded -- that is use
> after free -- right?
Sure, module code can't execute after module unloaded, it doesn't exist anymore.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Maninder Singh <maninder1.s@samsung.com>, <jeyu@redhat.com>,
<rusty@rustcorp.com.au>, <akpm@linux-foundation.org>,
<chris@chris-wilson.co.uk>, <joonas.lahtinen@linux.intel.com>,
<mhocko@suse.com>, <keescook@chromium.org>,
<jinb.park7@gmail.com>, <anisse@astier.eu>,
<rafael.j.wysocki@intel.com>, <zijun_hu@htc.com>,
<mingo@kernel.org>, <mawilcox@microsoft.com>,
<thgarnie@google.com>, <joelaf@google.com>,
<kirill.shutemov@linux.intel.com>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, <pankaj.m@samsung.com>,
<ajeet.y@samsung.com>, <hakbong5.lee@samsung.com>,
<a.sahrawat@samsung.com>, <lalit.mohan@samsung.com>,
<cpgs@samsung.com>, Vaneet Narang <v.narang@samsung.com>
Subject: Re: [PATCH v2] module: check if memory leak by module.
Date: Thu, 30 Mar 2017 17:31:45 +0300 [thread overview]
Message-ID: <06383e49-148e-e31f-e66e-e50db7df470b@virtuozzo.com> (raw)
In-Reply-To: <20170330133712.GA23946@amd>
On 03/30/2017 04:37 PM, Pavel Machek wrote:
>
>> 3) This might produce false positives. E.g. module may defer vfree() in workqueue, so the
>> actual vfree() call happens after module unloaded.
>
> Umm. Really?
>
I should have been more specific. I meant vfree() called by module from the interrupt context.
In that case the actual __vunmap() will be deferred via schedule_work() thus it might happen
after the module unloaded.
See 32fcfd40715e ("make vfree() safe to call from interrupt contexts")
> I agree that module may alloc memory and pass it to someone else. Ok
> so far.
>
Right. In the case with vfree() from interrupt we actually pass the memory to
the core code to free it later.
> But if module code executes after module is unloaded -- that is use
> after free -- right?
Sure, module code can't execute after module unloaded, it doesn't exist anymore.
next prev parent reply other threads:[~2017-03-30 14:30 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170329060315epcas5p1c6f7ce3aca1b2770c5e1d9aaeb1a27e1@epcas5p1.samsung.com>
2017-03-29 6:02 ` [PATCH v2] module: check if memory leak by module Maninder Singh
2017-03-29 6:02 ` Maninder Singh
2017-03-29 7:45 ` Michal Hocko
2017-03-29 7:45 ` Michal Hocko
2017-03-29 8:02 ` Miroslav Benes
2017-03-29 8:02 ` Miroslav Benes
2017-03-29 9:23 ` Vaneet Narang
2017-03-29 10:43 ` Michal Hocko
2017-03-29 10:43 ` Michal Hocko
2017-03-31 6:49 ` Joel Fernandes
2017-03-31 6:49 ` Joel Fernandes
2017-03-31 8:00 ` Michal Hocko
2017-03-31 8:00 ` Michal Hocko
2017-03-31 17:05 ` Joel Fernandes
2017-03-31 17:05 ` Joel Fernandes
2017-04-03 7:24 ` Michal Hocko
2017-04-03 7:24 ` Michal Hocko
2017-03-31 22:18 ` Jessica Yu
2017-03-31 22:18 ` Jessica Yu
2017-03-29 11:05 ` Andrey Ryabinin
2017-03-29 11:05 ` Andrey Ryabinin
2017-03-30 13:37 ` Pavel Machek
2017-03-30 14:31 ` Andrey Ryabinin [this message]
2017-03-30 14:31 ` Andrey Ryabinin
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=06383e49-148e-e31f-e66e-e50db7df470b@virtuozzo.com \
--to=aryabinin@virtuozzo.com \
--cc=a.sahrawat@samsung.com \
--cc=ajeet.y@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=anisse@astier.eu \
--cc=chris@chris-wilson.co.uk \
--cc=cpgs@samsung.com \
--cc=hakbong5.lee@samsung.com \
--cc=jeyu@redhat.com \
--cc=jinb.park7@gmail.com \
--cc=joelaf@google.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=keescook@chromium.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=lalit.mohan@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maninder1.s@samsung.com \
--cc=mawilcox@microsoft.com \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=pankaj.m@samsung.com \
--cc=pavel@ucw.cz \
--cc=rafael.j.wysocki@intel.com \
--cc=rusty@rustcorp.com.au \
--cc=thgarnie@google.com \
--cc=v.narang@samsung.com \
--cc=zijun_hu@htc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.