linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] powerpc/32: Fix early access to cpu_spec relocation
Date: Tue, 02 Aug 2016 15:53:01 +1000	[thread overview]
Message-ID: <1470117181.12584.14.camel@kernel.crashing.org> (raw)

Commit 9402c684613163888714df0955fa1f17142b08bf introduced a subtle bug
on 32-bit. When reading the cpu spec from the global, we not only need
to do a pointer relocation on the global address but also on the pointer
we read from it.

This fixes crashes reported on MPC5200 based machines.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Fixes: 9402c684613163888714df0955fa1f17142b08bf
--
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index defb299..fd36e13 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -154,7 +154,7 @@ static void do_final_fixups(void)
 
 void apply_feature_fixups(void)
 {
-	struct cpu_spec *spec = *PTRRELOC(&cur_cpu_spec);
+	struct cpu_spec *spec = PTRRELOC(*PTRRELOC(&cur_cpu_spec));
 
 	/*
 	 * Apply the CPU-specific and firmware specific fixups to kernel text

                 reply	other threads:[~2016-08-02  5:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1470117181.12584.14.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).