From: Oliver Upton <oliver.upton@linux.dev>
To: Vincent Donnefort <vdonnefort@google.com>
Cc: maz@kernel.org, tabba@google.com, kvmarm@lists.linux.dev,
kernel-team@android.com
Subject: Re: [PATCH] KVM: arm64: Fix __pkvm_init_vcpu cptr_el2 error path
Date: Thu, 19 Sep 2024 03:11:33 -0700 [thread overview]
Message-ID: <Zuv41W8FOFFnaw4v@linux.dev> (raw)
In-Reply-To: <20240918170502.1881517-1-vdonnefort@google.com>
On Wed, Sep 18, 2024 at 06:05:02PM +0100, Vincent Donnefort wrote:
> On an error, hyp_vcpu will be accessed while this memory has already
> been relinquished to the host and unmapped from the hypervisor. Move
> the CPTR assignment to prevent that access.
>
> Fixes: b5b9955617bc ("KVM: arm64: Eagerly restore host fpsimd/sve state in pKVM")
> Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
It's minor, but I'm guessing the original intent was to initialize
cptr_el2 outside of the vm_table_lock. So you could do an early return
instead:
if (ret) {
unmap_donated_memory(...);
return ret;
}
But again, minor. So:
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
--
Thanks,
Oliver
prev parent reply other threads:[~2024-09-19 10:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-18 17:05 [PATCH] KVM: arm64: Fix __pkvm_init_vcpu cptr_el2 error path Vincent Donnefort
2024-09-19 10:11 ` Oliver Upton [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=Zuv41W8FOFFnaw4v@linux.dev \
--to=oliver.upton@linux.dev \
--cc=kernel-team@android.com \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=tabba@google.com \
--cc=vdonnefort@google.com \
/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