From: Joerg Roedel <jroedel@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kvm@vger.kernel.org
Subject: Re: [bug report] x86/sev: Split up runtime #VC handler for correct state tracking
Date: Wed, 4 Aug 2021 16:23:26 +0200 [thread overview]
Message-ID: <YQqi3lKFmR7g/kIl@suse.de> (raw)
In-Reply-To: <20210804125834.GF22532@kadam>
On Wed, Aug 04, 2021 at 03:58:34PM +0300, Dan Carpenter wrote:
> exc_page_fault() <-- called with preempt disabled
> --> kvm_handle_async_pf()
> --> __kvm_handle_async_pf()
> --> kvm_async_pf_task_wait_schedule() calls schedule().
This call path can not be taken in the page-fault handler when called
from the #VC handler. To take this path the host needs to inject an
async page-fault, especially setting async pf flags, without injecting a
page-fault exception on its own ... and when the #VC handler is running.
KVM is not doing that.
Okay, the hypervisor can be malicious, but otherwise this can't happen.
To mitigate a malicious hypervisor threat here it might be a solution to
not call the page-fault handler directly from the #VC handler and let it
re-fault after the #VC handler returned.
Regards,
Joerg
next prev parent reply other threads:[~2021-08-04 14:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 9:57 [bug report] x86/sev: Split up runtime #VC handler for correct state tracking Dan Carpenter
2021-08-04 12:38 ` Joerg Roedel
2021-08-04 12:58 ` Dan Carpenter
2021-08-04 13:35 ` Joerg Roedel
2021-08-04 13:42 ` Dan Carpenter
2021-08-04 14:23 ` Joerg Roedel [this message]
2021-08-06 8:35 ` Dan Carpenter
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=YQqi3lKFmR7g/kIl@suse.de \
--to=jroedel@suse.de \
--cc=dan.carpenter@oracle.com \
--cc=kvm@vger.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