From: Song Liu <liu.song.a23@gmail.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Linux-MM <linux-mm@kvack.org>,
open list <linux-kernel@vger.kernel.org>,
Marc Dionne <marc.c.dionne@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] kmemleak: Do not corrupt the object_list during clean-up
Date: Wed, 9 Oct 2019 09:37:24 -0700 [thread overview]
Message-ID: <CAPhsuW4TOM+u+W2YwDkQjjZbDubPDR_69F0VMxSOzb6eRMPbaw@mail.gmail.com> (raw)
In-Reply-To: <5a75249e-47ee-bb7c-d281-31b385d8bb86@ozlabs.ru>
On Fri, Oct 4, 2019 at 8:11 PM Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>
>
>
> On 04/10/2019 23:46, Catalin Marinas wrote:
> > In case of an error (e.g. memory pool too small), kmemleak disables
> > itself and cleans up the already allocated metadata objects. However, if
> > this happens early before the RCU callback mechanism is available,
> > put_object() skips call_rcu() and frees the object directly. This is not
> > safe with the RCU list traversal in __kmemleak_do_cleanup().
> >
> > Change the list traversal in __kmemleak_do_cleanup() to
> > list_for_each_entry_safe() and remove the rcu_read_{lock,unlock} since
> > the kmemleak is already disabled at this point. In addition, avoid an
> > unnecessary metadata object rb-tree look-up since it already has the
> > struct kmemleak_object pointer.
> >
> > Fixes: c5665868183f ("mm: kmemleak: use the memory pool for early allocations")
> > Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > Reported-by: Marc Dionne <marc.c.dionne@gmail.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
>
>
> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Tested-by: Song Liu <songliubraving@fb.com>
This fixes my vm, which could not boot with 5.4-rc3.
Thanks,
Song
next prev parent reply other threads:[~2019-10-09 16:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-04 13:46 [PATCH] kmemleak: Do not corrupt the object_list during clean-up Catalin Marinas
2019-10-05 3:11 ` Alexey Kardashevskiy
2019-10-09 16:37 ` Song Liu [this message]
2019-10-09 16:37 ` Song Liu
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=CAPhsuW4TOM+u+W2YwDkQjjZbDubPDR_69F0VMxSOzb6eRMPbaw@mail.gmail.com \
--to=liu.song.a23@gmail.com \
--cc=aik@ozlabs.ru \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=marc.c.dionne@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).