Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1501843
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | James Hogan <james.hogan@imgtec.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] MIPS: KASLR: Fix handling of NULL FDT |
| Date | Mon, 17 Oct 2016 12:20:01 +0200 |
| Message-ID | <stdbr-2aY-1@gated-at.bofh.it> (permalink) |
| References | <std1L-26b-11@gated-at.bofh.it> |
| X-Original-To | Matt Redfearn <matt.redfearn@imgtec.com> |
| X-PGP-Universal | processed; by imgpgp01.kl.imgtec.org on Mon, 17 Oct 2016 11:07:59 +0100 |
| MIME-Version | 1.0 |
| Content-Type | multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RnlQjJ0d97Da+TV1" |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.24 (2015-08-30) |
| X-Originating-IP | [192.168.154.110] |
| X-Esg-Encrypt-Tag | 1cc78754 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 70 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Ralf Baechle <ralf@linux-mips.org>, <linux-mips@linux-mips.org>, "# 4 . 7+" <stable@vger.kernel.org>, <linux-kernel@vger.kernel.org> |
| X-Original-Date | Mon, 17 Oct 2016 11:08:22 +0100 |
| X-Original-Message-ID | <20161017100822.GA9443@jhogan-linux.le.imgtec.org> |
| X-Original-References | <1476698694-6685-1-git-send-email-matt.redfearn@imgtec.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1501843 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
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
>
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] MIPS: KASLR: Fix handling of NULL FDT Matt Redfearn <matt.redfearn@imgtec.com> - 2016-10-17 12:10 +0200 Re: [PATCH] MIPS: KASLR: Fix handling of NULL FDT James Hogan <james.hogan@imgtec.com> - 2016-10-17 12:20 +0200 Re: [PATCH] MIPS: KASLR: Fix handling of NULL FDT Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-10-17 15:50 +0200
csiph-web