public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>,
	Chuck Ebbert <76306.1226@compuserve.com>,
	In Cognito <defend.the.world@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>,
	bcrl@kvack.org
Subject: Re: Sysenter crash with Nested Task Bit set
Date: Mon, 18 Sep 2006 17:29:23 +0200	[thread overview]
Message-ID: <200609181729.23934.ak@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0609180741520.4388@g5.osdl.org>


> If we fix it in the task-switch code, we shouldn't need any other changes 
> (ie Chuck's change is unnecessary too), because then the process that sets 
> NT will happily die (with NT set), but switch away to something else and 
> nobody else will be affected.

Won't it die in the kernel with an oops on the next interrupt?
 
> So if I'm right, then this patch _should_ fix it. UNTESTED (and the 
> "ref_from_fork" special case doesn't clear NT, so it's strictly incompete, 
> but maybe somebody can test this?)

Are you sure this handles interrupts or nested syscalls 
before the context switch correctly?

I think it really needs to be handled in the sysenter path.

> 
> Hmm? Ingo? Comments?
> 
> Andi? I don't know if x86-64 honors NT in 64-bit mode, but if it does, it 
> needs something similar (assuming this works).

It doesn't task switch, but you would get a #GP in IRET at least.
Leaking that to another process is definitely not good.


>  #define switch_to(prev,next,last) do {					\
>  	unsigned long esi,edi;						\
> -	asm volatile("pushl %%ebp\n\t"					\
> +	asm volatile("pushfl\n\t"		/* Save flags */	\
> +		     "pushl %%ebp\n\t"					\

We used to do that pushfl/popfl some time ago, but Ben removed it because
it was slow on P4.  Ok, nobody thought of that case back then.

-Andi

  parent reply	other threads:[~2006-09-18 15:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-18  3:51 Sysenter crash with Nested Task Bit set Chuck Ebbert
2006-09-18  5:25 ` Andrew Morton
2006-09-18  8:44   ` Mike Galbraith
2006-09-18 15:11   ` Linus Torvalds
2006-09-18 15:06     ` Ingo Molnar
2006-09-18 15:29     ` Andi Kleen [this message]
2006-09-18 15:24       ` Ingo Molnar
2006-09-18 16:02       ` Linus Torvalds
2006-09-18 16:10         ` Linus Torvalds
2006-09-18 16:24           ` Jeremy Fitzhardinge
2006-09-18 16:12       ` Benjamin LaHaise
2006-09-18 16:39         ` Andi Kleen
2006-09-18 19:01           ` Jeremy Fitzhardinge
     [not found] <5a20704e0609171603s55ca52bap71dc2fa2c05d6741@mail.gmail.com>
2006-09-17 23:08 ` In Cognito

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=200609181729.23934.ak@suse.de \
    --to=ak@suse.de \
    --cc=76306.1226@compuserve.com \
    --cc=akpm@osdl.org \
    --cc=bcrl@kvack.org \
    --cc=defend.the.world@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@osdl.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