Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: Shawn Guo <shawnguo@kernel.org>
To: Anson.Huang@nxp.com
Cc: abel.vesa@nxp.com, viresh.kumar@linaro.org,
	s.hauer@pengutronix.de, linux-kernel@vger.kernel.org,
	Linux-imx@nxp.com, kernel@pengutronix.de,
	leonard.crestez@nxp.com, festevam@gmail.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V2 1/2] soc: imx8: Fix potential kernel dump in error path
Date: Tue, 18 Jun 2019 17:13:10 +0800
Message-ID: <20190618091309.GL29881@dragon> (raw)
In-Reply-To: <20190614080748.32997-1-Anson.Huang@nxp.com>

On Fri, Jun 14, 2019 at 04:07:47PM +0800, Anson.Huang@nxp.com wrote:
> From: Anson Huang <Anson.Huang@nxp.com>
> 
> When SoC's revision value is 0, SoC driver will print out
> "unknown" in sysfs's revision node, this "unknown" is a
> static string which can NOT be freed, this will caused below
> kernel dump in later error path which calls kfree:
> 
> kernel BUG at mm/slub.c:3942!
> Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
> Modules linked in:
> CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.2.0-rc4-next-20190611-00023-g705146c-dirty #2197
> Hardware name: NXP i.MX8MQ EVK (DT)
> pstate: 60000005 (nZCv daif -PAN -UAO)
> pc : kfree+0x170/0x1b0
> lr : imx8_soc_init+0xc0/0xe4
> sp : ffff00001003bd10
> x29: ffff00001003bd10 x28: ffff00001121e0a0
> x27: ffff000011482000 x26: ffff00001117068c
> x25: ffff00001121e100 x24: ffff000011482000
> x23: ffff000010fe2b58 x22: ffff0000111b9ab0
> x21: ffff8000bd9dfba0 x20: ffff0000111b9b70
> x19: ffff7e000043f880 x18: 0000000000001000
> x17: ffff000010d05fa0 x16: ffff0000122e0000
> x15: 0140000000000000 x14: 0000000030360000
> x13: ffff8000b94b5bb0 x12: 0000000000000038
> x11: ffffffffffffffff x10: ffffffffffffffff
> x9 : 0000000000000003 x8 : ffff8000b9488147
> x7 : ffff00001003bc00 x6 : 0000000000000000
> x5 : 0000000000000003 x4 : 0000000000000003
> x3 : 0000000000000003 x2 : b8793acd604edf00
> x1 : ffff7e000043f880 x0 : ffff7e000043f888
> Call trace:
>  kfree+0x170/0x1b0
>  imx8_soc_init+0xc0/0xe4
>  do_one_initcall+0x58/0x1b8
>  kernel_init_freeable+0x1cc/0x288
>  kernel_init+0x10/0x100
>  ret_from_fork+0x10/0x18
> 
> This patch fixes this potential kernel dump when a chip's
> revision is "unknown", it is done by checking whether the
> revision space can be freed.
> 
> Fixes: a7e26f356ca1 ("soc: imx: Add generic i.MX8 SoC driver")
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      parent reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  8:07 Anson.Huang
2019-06-14  8:07 ` [PATCH V2 2/2] soc: imx8: Use existing of_root directly Anson.Huang
2019-06-18  9:14   ` Shawn Guo
2019-06-18  9:44     ` Anson Huang
2019-06-18  9:13 ` Shawn Guo [this message]

Reply instructions:

You may reply publically 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=20190618091309.GL29881@dragon \
    --to=shawnguo@kernel.org \
    --cc=Anson.Huang@nxp.com \
    --cc=Linux-imx@nxp.com \
    --cc=abel.vesa@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=viresh.kumar@linaro.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

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox