From: Marc Zyngier <maz@kernel.org>
To: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org,
James Morse <james.morse@arm.com>,
Julien Thierry <julien.thierry.kdev@gmail.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Andrew Scull <ascull@google.com>, Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Quentin Perret <qperret@google.com>,
David Brazdil <dbrazdil@google.com>,
kernel-team@android.com
Subject: Re: [PATCH v2 11/11] KVM: arm64: Get rid of the AArch32 register mapping code
Date: Thu, 23 May 2024 19:18:57 +0100 [thread overview]
Message-ID: <86jzjkmlwu.wl-maz@kernel.org> (raw)
In-Reply-To: <678f6b8fe42f7a39eba4090a12a618cdbc710fa5.camel@linux.ibm.com>
On Thu, 23 May 2024 17:19:38 +0100,
Nina Schoetterl-Glausch <nsg@linux.ibm.com> wrote:
>
> On Thu, 2024-05-23 at 17:04 +0100, Marc Zyngier wrote:
>
> > Amazing. Thanks for spotting this. This is indeed broken. I guess this
> > was not spotted because userspace is not totally broken itself.
>
> So it's an actual bug and not just doing more work than necessary?
Definitely.
> Could corrupt the regs of a 64bit kernel?
Yup. If you have a 64bit guest with a 32bit userspace, and that you
restore the state at the point where the latter is live, with any
PSTATE bit set other than those in PSTATE.M, you corrupt the 64bit
GPRs by zeroing the top 32bit.
Linux as a guest is probably fine as it doesn't try to optimise the
GPR save/restore for a 32bit userspace and will restore the registers
from its stack (which itself is not corrupted), but that's still a
pretty bad situation.
> > Do you want to submit a fix adding the masking back? or should I do it
> > myself?
>
> You go ahead and do it :)
Will do shortly.
Thanks again,
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2024-05-23 18:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 16:40 [PATCH v2 00/11] KVM: arm64: Move PC/ELR/SPSR/PSTATE updatess to EL2 Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 01/11] KVM: arm64: Don't adjust PC on SError during SMC trap Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 02/11] KVM: arm64: Move kvm_vcpu_trap_il_is32bit into kvm_skip_instr32() Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 03/11] KVM: arm64: Make kvm_skip_instr() and co private to HYP Marc Zyngier
2021-05-05 14:23 ` Zenghui Yu
2021-05-05 16:46 ` Marc Zyngier
2021-05-06 6:33 ` Marc Zyngier
2021-05-06 11:43 ` Zenghui Yu
2021-05-06 14:29 ` Marc Zyngier
2021-05-09 13:07 ` Zenghui Yu
2021-05-10 7:59 ` Marc Zyngier
2021-05-06 17:17 ` Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 04/11] KVM: arm64: Move PC rollback on SError " Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 05/11] KVM: arm64: Move VHE direct sysreg accessors into kvm_host.h Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 06/11] KVM: arm64: Add basic hooks for injecting exceptions from EL2 Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 07/11] KVM: arm64: Inject AArch64 exceptions from HYP Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 08/11] KVM: arm64: Inject AArch32 " Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 09/11] KVM: arm64: Remove SPSR manipulation primitives Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 10/11] KVM: arm64: Consolidate exception injection Marc Zyngier
2020-11-02 16:40 ` [PATCH v2 11/11] KVM: arm64: Get rid of the AArch32 register mapping code Marc Zyngier
2024-05-23 14:25 ` Nina Schoetterl-Glausch
2024-05-23 16:04 ` Marc Zyngier
2024-05-23 16:19 ` Nina Schoetterl-Glausch
2024-05-23 18:18 ` 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=86jzjkmlwu.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=ascull@google.com \
--cc=dbrazdil@google.com \
--cc=james.morse@arm.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kernel-team@android.com \
--cc=kvm@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=nsg@linux.ibm.com \
--cc=qperret@google.com \
--cc=suzuki.poulose@arm.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).