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:	Tue, 26 Aug 2008 14:15:58 -0400
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	"Luiz Fernando N. Capitulino" <lcapitulino@...driva.com.br>
Cc:	Gerhard Brauer <gerhard.brauer@....de>,
	"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...e.hu>,
	linux-kernel@...r.kernel.org
Subject: Re: 2.6.{26.2,27-rc} oops on virtualbox

* Luiz Fernando N. Capitulino (lcapitulino@...driva.com.br) wrote:
> Em Tue, 26 Aug 2008 13:18:22 -0400
> Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca> escreveu:
> 
> | * Luiz Fernando N. Capitulino (lcapitulino@...driva.com.br) wrote:
> | > Em Tue, 26 Aug 2008 10:53:38 -0400
> | > Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca> escreveu:
> | > 
> | > | Then, after having tested (2), try this on top of it :
> | > | 
> | > | In arch/x86/kernel/alternative.c, alternatives_smp_switch()
> | > | 
> | > | Add   unsigned long flags;
> | > | Change 
> | > | spin_lock -> spin_lock_irqsave(&smp_alt, flags);
> | > | spin_unlock(&smp_alt); -> spin_unlock_irqrestore(&smp_alt, flags);
> | > 
> | >  Hmm, I can't find spin_lock functions in alternatives_smp_switch()
> | > looks like the current implementation is now using mutexes.
> | > 
> | 
> | Sorry, I was looking directly at the commit which caused the problem.
> | Yes, these modif should go on top of the text_poke -> text_poke_early.
> | 
> | So in current mainline, change, in alternatives_smp_switch() :
> | 
> | mutex_lock(&smp_alt);
> | ...
> | 
> | mutex_unlock(&smp_alt);
> | 
> | to
> | 
> | mutex_lock(&smp_alt);
> | local_irq_save(flags);
> | ...
> | 
> | local_irq_restore(flags);
> | mutex_unlock(&smp_alt);
> 
>  Did not help, same oops here.
> 

Ok, it might still be caused by paravirt and alternatives instruction
patching. What if you also do :

alternative_instructions()

+        unsigned long flags;
        /* The patching is not fully atomic, so try to avoid local interruptions
           that might execute the to be patched code.
           Other CPUs are not running. */
        stop_nmi();
#ifdef CONFIG_X86_MCE
        stop_mce();
#endif
+        local_irq_save(flags);


...
+        local_irq_restore(flags);
        restart_nmi();
#ifdef CONFIG_X86_MCE
        restart_mce();
#endif

?

Hrm,

Since those local_irq_save/restore occur _before_ the paravirt patching
is done, I wonder if there would be a race in the way cli/sti traps are
handled by Virtualbox wrt incoming interrupt ?

Thanks,

Mathieu

> -- 
> Luiz Fernando N. Capitulino

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
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