From: Marc Gonzalez <marc.w.gonzalez@free.fr>
To: Mike Rapoport <rppt@linux.ibm.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Frank Rowand <frowand.list@gmail.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Prateek Patel <prpatel@nvidia.com>,
DT <devicetree@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
stable <stable@vger.kernel.org>
Subject: Re: [RESEND PATCH v2] of: fix kmemleak crash caused by imbalance in early memory reservation
Date: Wed, 13 Feb 2019 10:27:48 +0100 [thread overview]
Message-ID: <5c9184f3-71c1-7875-52f7-616d299a9549@free.fr> (raw)
In-Reply-To: <20190213065734.GA14425@rapoport-lnx>
On 13/02/2019 07:57, Mike Rapoport wrote:
> Below is the version vs. current mmotm.
>
> From 9ea6dceb46067d4f1cbbdbec1189c8496aa0a4bc Mon Sep 17 00:00:00 2001
> From: Mike Rapoport <rppt@linux.ibm.com>
> Date: Mon, 4 Feb 2019 15:37:21 +0100
> Subject: [PATCH] of: fix kmemleak crash caused by imbalance in early memory reservation
Out of curiosity, why don't you send as a proper v3?
> Marc Gonzalez reported the following kmemleak crash:
>
> [...]
>
> The crash happens when a no-map area is allocated in
> early_init_dt_alloc_reserved_memory_arch(). The allocated region is
> registered with kmemleak, but it is then removed from memblock using
> memblock_remove() that is not kmemleak-aware.
>
> Replacing __memblock_alloc_base() with memblock_find_in_range()
Nit: in this new version, you're replacing memblock_phys_alloc_range()
with memblock_find_in_range() so I don't know if the comment still
applies.
> makes sure that the allocated memory is not added to kmemleak and then
> memblock_remove()'ing this memory is safe.
>
> As a bonus, since memblock_find_in_range() ensures the allocation in the
> specified range, the bounds check can be removed.
>
> Cc: stable@vger.kernel.org # 3.15+
> Fixes: 3f0c820664483 ("drivers: of: add initialization code for dynamic reserved memory")
> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Acked-by: Prateek Patel <prpatel@nvidia.com>
> Tested-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
next prev parent reply other threads:[~2019-02-13 9:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <d4facdc2-0581-929f-caa2-b9efa9bd8f97@arm.com>
[not found] ` <CAL_JsqKFT8J6g02gxeBiTfBb_XHhp2-ZNB6DgaLPK85kNZGRig@mail.gmail.com>
[not found] ` <20190121143704.GE29504@arrakis.emea.arm.com>
[not found] ` <CAL_JsqKQb34zVNTzo9DLNiDwmWGxkrKezSOjwCUPAvgzUoLYjg@mail.gmail.com>
[not found] ` <20190121174234.GC26461@rapoport-lnx>
[not found] ` <2bb30550-435a-046c-4f45-21dd594aa695@free.fr>
[not found] ` <3c886941-bf9d-f040-b568-ee7a8eba9a04@free.fr>
[not found] ` <CGME20190123055509epcas3p18a6d66fa08412f2308cb2c1997328ea8@epcas3p1.samsung.com>
[not found] ` <20190123055414.GA4747@rapoport-lnx>
[not found] ` <78f4ea8a-996d-038e-9e33-5ff02fa2c43f@samsung.com>
[not found] ` <20190123123143.GE4747@rapoport-lnx>
[not found] ` <f2bdb061-2fdf-ee78-fc46-a38ebb40b03f@free.fr>
2019-02-04 10:10 ` [PATCH v2] of: fix kmemleak crash Marc Gonzalez
2019-02-04 15:25 ` Greg Kroah-Hartman
2019-02-04 16:41 ` Rob Herring
2019-02-04 14:37 ` [RESEND PATCH v2] of: fix kmemleak crash caused by imbalance in early memory reservation Marc Gonzalez
[not found] ` <20190207163214.45C1B218D3@mail.kernel.org>
2019-02-08 10:02 ` Mike Rapoport
2019-02-11 16:47 ` Marc Gonzalez
2019-02-12 16:03 ` Rob Herring
2019-02-12 21:50 ` Stephen Rothwell
2019-02-12 21:52 ` Andrew Morton
2019-02-12 22:12 ` Rob Herring
2019-02-13 6:57 ` Mike Rapoport
2019-02-13 9:27 ` Marc Gonzalez [this message]
2019-02-13 16:30 ` Mike Rapoport
2019-03-06 2:12 ` Guenter Roeck
2019-03-06 13:39 ` Rob Herring
2019-03-06 16:18 ` Guenter Roeck
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=5c9184f3-71c1-7875-52f7-616d299a9549@free.fr \
--to=marc.w.gonzalez@free.fr \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=prpatel@nvidia.com \
--cc=robh+dt@kernel.org \
--cc=rppt@linux.ibm.com \
--cc=sfr@canb.auug.org.au \
--cc=stable@vger.kernel.org \
/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).