linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Qixiang Xu <qixiang.xu@outlook.com>
Cc: "oliver.upton@linux.dev" <oliver.upton@linux.dev>,
	"will@kernel.org" <will@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] KVM: arm64: Make nVHE ASLR conditional on nokaslr
Date: Fri, 06 Sep 2024 08:47:18 +0100	[thread overview]
Message-ID: <86frqdusu1.wl-maz@kernel.org> (raw)
In-Reply-To: <SEZPR04MB63194C0FCB4765A8ABF4A2709E9E2@SEZPR04MB6319.apcprd04.prod.outlook.com>

On Fri, 06 Sep 2024 08:19:07 +0100,
Qixiang Xu <qixiang.xu@outlook.com> wrote:
> 
> Marc,
> 
> Thanks for your reply. 
> 
> > This is a change in behaviour that would leave the 2 implementations
> > affected by Spectre-v3a unmitigated and leaking information to
> > *guests*, while they would have been safe until this change. Is this
> > what we really want to do?
> 
> The reason for adding this is to make debugging nvhe hyp code easier. 
> Otherwise, we would need to calculate the offset every time.
> Do you have any better suggestions for the debugging?

You already have facilities to dump stacktraces from the HYP code, and
Vincent's tracing infrastructure is available on the list (feel free
to review it!).

And as I said, I'm not opposed to disabling the randomisation with a
command-line option. I oppose to using 'nokaslr' for this, as it
changes the existing behaviour.

> > This is also not disabling the whole thing, since we still do the
> > indirect vector dance.
> 
> I'm not sure if my understanding is correct, but based on 
> the hyp_map_vectors function, the address of the indirect vector
> is only related to __io_map_base and is not random.

Of course it isn't random. It is in the idmap, since VBAR_EL2 can be
leaked to EL1, and that's the whole point that the only thing you can
leak isn't random.

But when you decide to disable randomisation, you might as well
disable the indirection, which adds extra complexity for no benefit.

You may want to read [1] to get the context of what you are changing.

	M.

[1] https://lore.kernel.org/all/20180314165049.30105-1-marc.zyngier@arm.com/

-- 
Without deviation from the norm, progress is not possible.


      reply	other threads:[~2024-09-06  7:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240905061659.3410362-1-qixiang.xu@outlook.com>
2024-09-05  6:30 ` [PATCH 0/1] KVM: arm64: Make nVHE ASLR conditional on cmdline nokaslr qixiang.xu
     [not found] ` <20240905063026.3411766-1-qixiang.xu@outlook.com>
2024-09-05  6:30   ` [PATCH 1/1] KVM: arm64: Make nVHE ASLR conditional on nokaslr qixiang.xu
2024-09-05  8:11     ` Marc Zyngier
2024-09-06  7:19       ` Qixiang Xu
2024-09-06  7:47         ` Marc Zyngier [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=86frqdusu1.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=qixiang.xu@outlook.com \
    --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;
as well as URLs for NNTP newsgroup(s).