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:   Fri, 18 Dec 2020 16:33:56 +0100
From:   Heiko Carstens <hca@...ux.ibm.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Steven Rostedt <rostedt@...dmis.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org, Sven Schnelle <svens@...ux.ibm.com>
Subject: Re: __local_bh_enable_ip() vs lockdep

On Wed, Dec 16, 2020 at 06:52:59PM +0100, Peter Zijlstra wrote:
> On Tue, Dec 15, 2020 at 02:47:24PM -0500, Steven Rostedt wrote:
> > On Tue, 15 Dec 2020 20:01:52 +0100
> > Heiko Carstens <hca@...ux.ibm.com> wrote:
> > 
> > > Hello,
> > > 
> > > the ftrace stack tracer kernel selftest is able to trigger the warning
> > > below from time to time. This looks like there is an ordering problem
> > > in __local_bh_enable_ip():
> > > first there is a call to lockdep_softirqs_on() and afterwards
> > > preempt_count_sub() is ftraced before it was able to modify
> > > preempt_count:
> > 
> > Don't run ftrace stack tracer when debugging lockdep. ;-)
> > 
> >   /me runs!
> 
> Ha!, seriously though; that seems like something we've encountered
> before, but my google-fu is failing me.
> 
> Do you remember what, if anything, was the problem with this?
> 
> ---
> diff --git a/kernel/softirq.c b/kernel/softirq.c
> index d5bfd5e661fc..9d71046ea247 100644
> --- a/kernel/softirq.c
> +++ b/kernel/softirq.c
> @@ -186,7 +186,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
>  	 * Keep preemption disabled until we are done with
>  	 * softirq processing:
>  	 */
> -	preempt_count_sub(cnt - 1);
> +	__preempt_count_sub(cnt - 1);
>  
>  	if (unlikely(!in_interrupt() && local_softirq_pending())) {
>  		/*

FWIW,

Tested-by: Heiko Carstens <hca@...ux.ibm.com>

Peter, will you make proper patch out of this?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ