From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Matt Redfearn <matt.redfearn@imgtec.com>,
Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, "# 4 . 7+" <stable@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: KASLR: Fix handling of NULL FDT
Date: Mon, 17 Oct 2016 16:47:55 +0300 [thread overview]
Message-ID: <02ddfa7e-62a5-8ef2-393f-cdd9b5f76bb8@cogentembedded.com> (raw)
In-Reply-To: <1476698694-6685-1-git-send-email-matt.redfearn@imgtec.com>
Hello.
On 10/17/2016 01:04 PM, Matt Redfearn wrote:
> If platform code returns a NULL pointer to the FDT, initial_boot_params
> will not get set to a valid pointer and attempting to find the /chosen
> node in it will cause a NULL pointer dereference and the kernel to crash
> immediately on startup - with no output to the console.
>
> Fix this by checking that initial_boot_params is valid before using it.
>
> Fixes: 405bc8fd12f5 ("MIPS: Kernel: Implement KASLR using CONFIG_RELOCATABLE")
> Cc: <stable@vger.kernel.org> # 4.7+
> Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
> ---
>
> arch/mips/kernel/relocate.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/mips/kernel/relocate.c b/arch/mips/kernel/relocate.c
> index ca1cc30c0891..8810183840ca 100644
> --- a/arch/mips/kernel/relocate.c
> +++ b/arch/mips/kernel/relocate.c
> @@ -200,6 +200,7 @@ static inline __init unsigned long get_random_boot(void)
>
> #if defined(CONFIG_USE_OF)
> /* Get any additional entropy passed in device tree */
> + if (initial_boot_params)
> {
CodingStyle: *if* and { should be on the same line.
[...]
MBR, Sergei
prev parent reply other threads:[~2016-10-17 13:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 10:04 Matt Redfearn
2016-10-17 10:08 ` James Hogan
2016-10-17 13:47 ` Sergei Shtylyov [this message]
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=02ddfa7e-62a5-8ef2-393f-cdd9b5f76bb8@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=matt.redfearn@imgtec.com \
--cc=ralf@linux-mips.org \
--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
all inboxes | Powered by JetHome®