From: Brian Norris <computersforpeace@gmail.com>
To: Kevin Hao <haokexin@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>, linux-mtd@lists.infradead.org
Subject: Re: [PATCH v2 2/2] mtd/ftl: fix the double free of the buffers allocated in build_maps()
Date: Mon, 14 Jul 2014 18:44:22 -0700 [thread overview]
Message-ID: <20140715014422.GR7537@ld-irv-0074> (raw)
In-Reply-To: <1404354926-25930-1-git-send-email-haokexin@gmail.com>
On Thu, Jul 03, 2014 at 10:35:26AM +0800, Kevin Hao wrote:
> I got the following panic on my fsl p5020ds board.
>
> Unable to handle kernel paging request for data at address 0x7375627379737465
> Faulting instruction address: 0xc000000000100778
> Oops: Kernel access of bad area, sig: 11 [#1]
> SMP NR_CPUS=24 CoreNet Generic
...
> It seems that the corrupted partition header on my mtd device triggers
> a bug in the ftl. In function build_maps() it will allocate the buffers
> needed by the mtd partition, but if something goes wrong such as kmalloc
> failure, mtd read error or invalid partition header parameter, it will
> free all allocated buffers and then return non-zero. In my case, it
> seems that partition header parameter 'NumTransferUnits' is invalid.
>
> And the ftl_freepart() is a function which free all the partition
> buffers allocated by build_maps(). Given the build_maps() is a self
> cleaning function, so there is no need to invoke this function even
> if build_maps() return with error. Otherwise it will causes the
> buffers to be freed twice and then weird things would happen.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
> v2: Just update the commit log and add Cc stable.
Thanks for the updated description. Pushed to l2-mtd.git. Thanks!
Brian
next prev parent reply other threads:[~2014-07-15 1:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-16 7:52 [PATCH 0/2] mtd/ftl: fix the double free of buffers Kevin Hao
2014-06-16 7:52 ` [PATCH 1/2] mtd/ftl: drop the useless VirtualPageMap in partition_t Kevin Hao
2014-07-03 0:27 ` Brian Norris
2014-06-16 7:52 ` [PATCH 2/2] mtd/ftl: fix the double free of the buffers allocated in build_maps() Kevin Hao
2014-07-03 2:35 ` [PATCH v2 " Kevin Hao
2014-07-15 1:44 ` Brian Norris [this message]
2014-07-03 0:37 ` [PATCH 0/2] mtd/ftl: fix the double free of buffers Brian Norris
2014-07-03 2:11 ` Kevin Hao
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=20140715014422.GR7537@ld-irv-0074 \
--to=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=haokexin@gmail.com \
--cc=linux-mtd@lists.infradead.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