linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: kaslr: use callee saved register to preserve SCTLR across C call
Date: Thu, 24 Mar 2016 16:19:37 +0000	[thread overview]
Message-ID: <20160324161937.GD9113@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <1458581711-13950-1-git-send-email-ard.biesheuvel@linaro.org>

On Mon, Mar 21, 2016 at 06:35:11PM +0100, Ard Biesheuvel wrote:
> The KASLR code incorrectly expects the contents of x18 to be preserved
> across a call into C code, and uses it to stash the contents of SCTLR_EL1
> before enabling the MMU. If the MMU needs to be disabled again to create
> the randomized kernel mapping, x18 is written back to SCTLR_EL1, which is
> likely to crash the system if x18 has been clobbered by kasan_early_init()
> or kaslr_early_init(). So use x22 instead, which is not in use so far in
> head.S
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Applied. Thanks.

-- 
Catalin

      reply	other threads:[~2016-03-24 16:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 17:35 [PATCH] arm64: kaslr: use callee saved register to preserve SCTLR across C call Ard Biesheuvel
2016-03-24 16:19 ` Catalin Marinas [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=20160324161937.GD9113@e104818-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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).