mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>, <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 11:08:22 +0100	[thread overview]
Message-ID: <20161017100822.GA9443@jhogan-linux.le.imgtec.org> (raw)
In-Reply-To: <1476698694-6685-1-git-send-email-matt.redfearn@imgtec.com>

[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]

Hi Matt,

On Mon, Oct 17, 2016 at 11:04:54AM +0100, 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)
>  	{

The open brace should be on the same line as the if really.

Cheers
James

>  		int node, len;
>  		u64 *prop;
> -- 
> 2.7.4
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2016-10-17 10:10 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 [this message]
2016-10-17 13:47 ` Sergei Shtylyov

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=20161017100822.GA9443@jhogan-linux.le.imgtec.org \
    --to=james.hogan@imgtec.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®