All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Nadav Amit <nadav.amit@gmail.com>
Cc: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>,
	Takuya Yoshikawa <takuya.yoshikawa@gmail.com>,
	Nadav Amit <namit@cs.technion.ac.il>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] KVM: Exception during emulation decode should propagate
Date: Thu, 12 Jan 2012 12:16:31 +0200	[thread overview]
Message-ID: <4F0EB2FF.30009@redhat.com> (raw)
In-Reply-To: <0C475788-593F-46AA-8BE0-274E6765D46D@gmail.com>

On 01/12/2012 11:07 AM, Nadav Amit wrote:
> >> 
> >> When I cleaned up insn_fetch(), I thought that fetching the instruction
> >> which is being executed by the guest cannot cause #PF.
> >> 
> >> The possibility that a meaningless userspace might similtaneously unmap
> >> the page, noted by Avi IIRC, was ignored intentionally, so we just fail
> >> in such a case.
> >> 
> >> Did you see any real problem?
>
> Well, I run some research project for which I emulate instructions quite
> often. I do see a real problem with Linux 3.0.0. Please note AFAIK #GP
> might occur as well during instruction fetch. I don't think failing is the
> right behavior in such case - there is no real reason to fail.
>
> Please tell me whether you are OK with KVM failing in such a scenario.

So long as it's just the guest who is affected (at the same privilege
level; we don't want guest userspace to cause a host failure).

We might have issues with userspace causing such a failure, or a nested
guest.  I see we already check for that in handle_emulation_failure()
(but not userspace).

> If not - I'll send an updated patch (in which x86_decode_insn returns
> EMULATION_OK when rc == X86EMUL_PROPAGATE_FAULT).

It guess it's better to be correct in the emulator than rely on a
failure allowing for guest-internal DoS.

-- 
error compiling committee.c: too many arguments to function

      parent reply	other threads:[~2012-01-12 10:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11 16:53 [PATCH 1/2] KVM: Exception during emulation decode should propagate Nadav Amit
2012-01-11 16:53 ` [PATCH 2/2] KVM: Fix writeback on page boundary that propagate changes in spite of #PF Nadav Amit
2012-01-12 10:12   ` Gleb Natapov
2012-01-12 10:21     ` Avi Kivity
2012-01-12 10:27       ` Gleb Natapov
2012-01-14 18:27         ` Nadav Amit
2012-01-11 22:11 ` [PATCH 1/2] KVM: Exception during emulation decode should propagate Takuya Yoshikawa
2012-01-12  0:26   ` Takuya Yoshikawa
2012-01-12  9:07     ` Nadav Amit
2012-01-12  9:14       ` Takuya Yoshikawa
2012-01-12 10:16       ` Avi Kivity [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=4F0EB2FF.30009@redhat.com \
    --to=avi@redhat.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=nadav.amit@gmail.com \
    --cc=namit@cs.technion.ac.il \
    --cc=takuya.yoshikawa@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yoshikawa.takuya@oss.ntt.co.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.