From: Pranith Kumar <bobby.prani+qemu@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Jann Horn <jannh@google.com>,
Qemu Developers <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [BUG] user-to-root privesc inside VM via bad translation caching
Date: Wed, 22 Mar 2017 12:29:58 -0400 [thread overview]
Message-ID: <CAJhHMCDfmT_zrnuEBcmoJ+CJV9j8CB79ybehWoMBeh3rd+hA3Q@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA-x8CbqVpnaszmdZzLZt6+urxSntdWxLHeFXAOy327OqA@mail.gmail.com>
On Wed, Mar 22, 2017 at 11:21 AM, Peter Maydell
<peter.maydell@linaro.org> wrote:
> On 22 March 2017 at 15:14, Pranith Kumar <bobby.prani+qemu@gmail.com> wrote:
>> On Wed, Mar 22, 2017 at 11:04 AM, Peter Maydell
>> <peter.maydell@linaro.org> wrote:
>>> This doesn't look right because it means we'll check
>>> only after we've emitted all the code to do the
>>> instruction operation, so the effect will be
>>> "execute instruction, then take illegal-opcode
>>> exception".
>
>> The pc is restored to original address (s->pc = pc_start), so the
>> exception will overwrite the generated illegal instruction and will be
>> executed first.
>
> s->pc is the guest PC -- moving that backwards will
> not do anything about the generated TCG IR that's
> already been written. You'd need to rewind the
> write pointer in the IR stream, which there is
> no support for doing AFAIK.
Ah, OK. Thanks for the explanation. May be we should check the size of
the instruction while decoding the prefixes and error out once we
exceed the limit. We would not generate any IR code.
--
Pranith
next prev parent reply other threads:[~2017-03-22 16:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-20 14:36 [Qemu-devel] [BUG] user-to-root privesc inside VM via bad translation caching Jann Horn
2017-03-20 14:46 ` Peter Maydell
2017-03-22 14:55 ` Pranith Kumar
2017-03-22 15:04 ` Peter Maydell
2017-03-22 15:14 ` Pranith Kumar
2017-03-22 15:21 ` Peter Maydell
2017-03-22 16:29 ` Pranith Kumar [this message]
2017-03-22 20:01 ` Richard Henderson
2017-03-23 10:27 ` Paolo Bonzini
2017-03-23 16:50 ` Pranith Kumar
2017-03-23 17:37 ` Paolo Bonzini
2017-03-23 17:43 ` Pranith Kumar
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=CAJhHMCDfmT_zrnuEBcmoJ+CJV9j8CB79ybehWoMBeh3rd+hA3Q@mail.gmail.com \
--to=bobby.prani+qemu@gmail.com \
--cc=jannh@google.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).