linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: halfdog <me@halfdog.net>, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Sanitize CPU-state when switching from virtual-8086 mode to other task
Date: Tue, 31 Dec 2013 14:21:06 -0500	[thread overview]
Message-ID: <20131231192106.GA22535@phenom.dumpdata.com> (raw)
In-Reply-To: <52C31027.2030101@zytor.com>

On Tue, Dec 31, 2013 at 10:42:47AM -0800, H. Peter Anvin wrote:
> On 12/30/2013 07:52 AM, halfdog wrote:
> >>
> >> Still in VirtualBox?
> > 
> > Yes, again: after comparing the results from initrd on real hardware
> > with Vbox, I'm getting to understand the timing problem involved and why
> > timing in VBox is different: The test program usually OOPSes when
> > touching FPU multiple times, otherwise, when terminated before second
> > FPU-interacation, it OOPSes on next invocation, stumbling over invalid
> > CPU state from prior invocation. With improved code, I can rather
> > reliably bring CPU into that state, so that next process invoked and
> > touching FPU/MMX-state is OOPSed. Currently searching SUID-binaries and
> > running UID=0 daemons, that might show interesting reaction on that
> > event, but only on DOS level yet, e.g. after running V2 test program
> > once and then connecting via SSH, this currently kills the ssh daemon
> > nicely.
> > 
> > It seems that machine lockup occurs when e.g. switch to idle task
> > happens at exactly the right moment, which I currently cannot trigger on
> > real hardware, but still working on that.
> > 
> 
> I'm still wondering if this is a VirtualBox-specific problem or if it is
> something that *could* occur on hardware, or in other virtualization
> environments (KVM, Xen HVM, Hy-perV, VMware etc.)

So, I am wondering if this is related to " x86/fpu: CR0.TS should be set before trap
into PV guest's #NM exception handle" which does have a similar pattern - you
do enough of the task switches and the FPU is screwed.

See http://mid.gmane.org/1383720072-6242-1-git-send-email-gaoyang.zyh@taobao.com

(I thought there was a thread about this on LKML too but I can't
find it).
> 
> 	-hpa
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2013-12-31 19:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-28 22:02 Sanitize CPU-state when switching from virtual-8086 mode to other task halfdog
2013-12-29  2:37 ` H. Peter Anvin
2013-12-29 20:44   ` halfdog
2013-12-30  1:18     ` H. Peter Anvin
2013-12-30 15:52       ` halfdog
2013-12-31 18:42         ` H. Peter Anvin
2013-12-31 19:21           ` Konrad Rzeszutek Wilk [this message]
2013-12-31 22:40             ` H. Peter Anvin
2014-01-03 23:07               ` Sanitize FPU-state when switching tasks (was sanitize CPU-state when switching from virtual-8086 mode to other task) halfdog
2014-01-08  7:45               ` Sanitize CPU-state " halfdog
2014-01-08 17:42                 ` H. Peter Anvin
2014-01-08 19:36                   ` Borislav Petkov
2014-01-08 21:28                     ` halfdog
2014-01-08 22:39                       ` H. Peter Anvin
2014-01-09 22:58                         ` Borislav Petkov
2014-01-10  0:42                           ` Linus Torvalds
2014-01-10  2:13                             ` H. Peter Anvin
2014-01-10 10:06                               ` Borislav Petkov
2014-01-10 11:16                                 ` Linus Torvalds
2014-01-10 11:34                                   ` Borislav Petkov
2014-01-10 16:11                                   ` H. Peter Anvin
2014-01-12  3:22                             ` [tip:x86/urgent] x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround tip-bot for Linus Torvalds
2014-01-09 22:50                       ` Sanitize CPU-state when switching tasks (was sanitize CPU-state when switching from virtual-8086 mode to other task) halfdog
2014-01-09 23:02                         ` Borislav Petkov

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=20131231192106.GA22535@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@halfdog.net \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).