lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 28 Nov 2011 23:33:46 -0800
From:	Paul Turner <pjt@...gle.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Steven Rostedt <rostedt@...dmis.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Subject: Re: Perhaps a side effect regarding NMI returns

On Mon, Nov 28, 2011 at 8:53 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Mon, Nov 28, 2011 at 8:07 PM, Steven Rostedt <rostedt@...dmis.org> wrote:
>>
>> If enabling interrupts also enables NMIs, then there's no side effect.
>
> The only thing that enables NMI's again is 'iret', afaik. Of course,
> it can be *any* iret, so once you enable interrupts, you can get a
> timer interrupt, and the timer interrupt returning with iret will
> re-enable NMI's then too.
>

I double checked versus the manuals tonight after seeing this and I
believe this correct -- an iret is required; some of the verbage is
reasonably explicit to this fact.

> I would suggest that the actual NMI handler itself should probably
> never use that paranoid exit at all, and just always use a regular
> iret. Screw scheduling and TIF checks.
>
> Probably only the exceptions that can happen *during* NMI (eg debug,
> stack exception, double-fault etc) should use the paranoid versions
> that try to avoid using iret.
>
> Because I think you're right - we shouldn't call schedule() from
> within the NMI handler, even if we do enable interrupts and switch to
> the normal stack. Even if it probably does happen to work normally.
>
> But I have to admit to not necessarily thinking it through a lot.
>

At a high level I think we could apply the same logic from the first
paragraph; namely that we will see a timer tick within a jiffy (where
we will have an opportunity to process TIF flags) and it's better to
push schedule() out than the NMI handler.

That said, if TIF_RESCHED has been set by a higher priority RT task
this temporary inversion may not be appreciated.  It's probably worth
fixing properly.

- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ