xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Tim Deegan <tim@xen.org>, Eddie Dong <eddie.dong@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH] VMX: don't crash processing 'd' debug key
Date: Fri, 8 Nov 2013 16:09:59 +0000	[thread overview]
Message-ID: <527D0CD7.6050701@citrix.com> (raw)
In-Reply-To: <527D199A02000078001014C6@nat28.tlf.novell.com>

On 08/11/13 16:04, Jan Beulich wrote:
>>>> On 07.11.13 at 20:08, Tim Deegan <tim@xen.org> wrote:
>> At 10:44 +0000 on 07 Nov (1383817496), Jan Beulich wrote:
>>> @@ -675,7 +675,17 @@ void vmx_get_segment_register(struct vcp
>>>  {
>>>      unsigned long attr = 0, sel = 0, limit;
>>>  
>>> -    vmx_vmcs_enter(v);
>>> +    /*
>>> +     * We may get here in the context of dump_execstate(), which may have
>>> +     * interrupted context switching between setting "current" and
>>> +     * vmx_do_resume() reaching the end of vmx_load_vmcs(). That would make
>>> +     * all the VMREADs below fail if we don't bail right away.
>>> +     */
>>> +    if ( unlikely(!vmx_vmcs_enter(v)) )
>>> +    {
>>> +        memset(reg, 0, sizeof(*reg));
>>> +        return;
>> It would be nice to print something here, at least on the first
>> instance.  Otherwise someone looking at bizarre debugkey output would
>> have to know (and remember) about this path.
> Did this.
>
>> I'd also be inclined to ASSERT that, e.g. interrupts are disabled here
>> -- if for any reason this function ever starts corrupting register
>> state on other paths, we'll want to know about it quickly!
> But I'm rather hesitant to do this. If anything, we'd need per-CPU
> state tracking whether we're in do_invalid_op()'s main switch.
>
> Jan
>

I agree - the debug keys are hardly normal operation, and we don't want
to ASSERT() in a debugkey.

Perhaps an alternative would be a short printk indicating that if this
is debugkey then the caller was unlucky and should try again, as we know
there is a short vulnerable window?

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2013-11-08 16:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 10:44 [PATCH] VMX: don't crash processing 'd' debug key Jan Beulich
2013-11-07 14:34 ` Andrew Cooper
2013-11-07 14:49   ` Jan Beulich
2013-11-07 15:35     ` Andrew Cooper
2013-11-07 19:08 ` Tim Deegan
2013-11-08 16:04   ` Jan Beulich
2013-11-08 16:09     ` Andrew Cooper [this message]
2013-11-08 16:11       ` Andrew Cooper
2013-11-08 16:15       ` Jan Beulich
2013-11-08 16:55       ` Tim Deegan
2013-11-11 12:55         ` [PATCH v3] " Jan Beulich
2013-11-11 13:13           ` Keir Fraser
2013-11-08 16:07   ` [PATCH v2] " Jan Beulich

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=527D0CD7.6050701@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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).