public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Amit Daniel Kachhap <amit.kachhap@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH] arm64: sync kernel APIAKey when installing
Date: Tue, 21 Apr 2020 14:31:54 +0100	[thread overview]
Message-ID: <20200421133153.GB12076@gaia> (raw)
In-Reply-To: <20200421123150.GA17875@willie-the-truck>

On Tue, Apr 21, 2020 at 01:31:51PM +0100, Will Deacon wrote:
> On Tue, Apr 21, 2020 at 01:10:14PM +0100, Mark Rutland wrote:
> > A direct write to a APxxKey_EL1 register requires a context
> > synchronization event to ensure that indirect reads made by subsequent
> > instructions (e.g. AUTIASP, PACIASP) observe the new value.
> > 
> > When we initialize the boot task's APIAKey in boot_init_stack_canary()
> > via ptrauth_keys_switch_kernel() we miss the necessary ISB, and so there
> > is a window where instructions are not guaranteed to use the new APIAKey
> > value. This has been observed to result in boot-time crashes where
> > PACIASP and AUTIASP within a function used a mixture of the old and new
> > key values.
> > 
> > Fix this by having ptrauth_keys_switch_kernel() synchronize the new key
> > value with an ISB. At the same time, __ptrauth_key_install() is renamed
> > to __ptrauth_key_install_nosync() so that it is obvious that this
> > performs no synchronization itself.
> > 
> > Fixes: 28321582334c261c ("arm64: initialize ptrauth keys for kernel booting task")
> > Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> > Reported-by: Will Deacon <will@kernel.org>
> > Cc: Amit Daniel Kachhap <amit.kachhap@arm.com>
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Marc Zyngier <maz@kernel.org>
> > ---
> >  arch/arm64/include/asm/pointer_auth.h | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> Tested-by: Will Deacon <will@kernel.org>
> 
> Catalin -- please can you queue this for -rc3?

I will. Thanks.

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2020-04-21 13:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 12:10 [PATCH] arm64: sync kernel APIAKey when installing Mark Rutland
2020-04-21 12:31 ` Will Deacon
2020-04-21 13:31   ` 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=20200421133153.GB12076@gaia \
    --to=catalin.marinas@arm.com \
    --cc=amit.kachhap@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=will@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