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:	Wed, 13 Aug 2008 19:38:12 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Mark Langsdorf <mark.langsdorf@....com>
Cc:	linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: invalidate caches before going into suspend


* Mark Langsdorf <mark.langsdorf@....com> wrote:

> > to make sure the compiler doesnt ever insert something into this 
> > codepath? [ And note the double cli which would be further 
> > robustification - in theory we could get a spurious interrupt 
> > straight after the wbinvd. ] Hm?
> 
> I don't think it's necessary.  I can submit a delta patch later if you 
> think it's really necessary.

this sequence:

> diff -r 1e74a821dd00 arch/x86/kernel/process_32.c
> --- a/arch/x86/kernel/process_32.c	Tue Aug 12 12:04:12 2008 -0500
> +++ b/arch/x86/kernel/process_32.c	Wed Aug 13 06:40:00 2008 -0500
> @@ -95,11 +95,11 @@ static inline void play_dead(void)
>  {
>  	/* This must be done before dead CPU ack */
>  	cpu_exit_clear();
> -	wbinvd();
>  	mb();
>  	/* Ack it */
>  	__get_cpu_var(cpu_state) = CPU_DEAD;
>  
> +	wbinvd();
>  	/*
>  	 * With physical CPU hotplug, we should halt the cpu
>  	 */

is still unsafe somewhat, as the cli only comes afterwards:

        local_irq_disable();
        while (1)
                halt();

so there's a small race open for some stray irq to come before the CLI.

Also, any of the primitives could be instrumented in theory and more 
code could be inserted - it's really the best approach to unify them 
into a single primitive, like the wbinvd_halt() API i suggested in the 
previous mail.

And it deserves a few comments as well.

	Ingo
--
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