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, 9 Oct 2020 09:11:11 -0700
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Qian Cai <cai@...hat.com>
Cc:     "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ingo Molnar <mingo@...nel.org>, x86 <x86@...nel.org>,
        linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Boqun Feng <boqun.feng@...il.com>
Subject: Re: [tip: locking/core] lockdep: Fix lockdep recursion

On Fri, Oct 09, 2020 at 11:30:38AM -0400, Qian Cai wrote:
> On Fri, 2020-10-09 at 06:58 -0700, Paul E. McKenney wrote:
> > On Fri, Oct 09, 2020 at 09:41:24AM -0400, Qian Cai wrote:
> > > On Fri, 2020-10-09 at 07:58 +0000, tip-bot2 for Peter Zijlstra wrote:
> > > > The following commit has been merged into the locking/core branch of tip:
> > > > 
> > > > Commit-ID:     4d004099a668c41522242aa146a38cc4eb59cb1e
> > > > Gitweb:        
> > > > https://git.kernel.org/tip/4d004099a668c41522242aa146a38cc4eb59cb1e
> > > > Author:        Peter Zijlstra <peterz@...radead.org>
> > > > AuthorDate:    Fri, 02 Oct 2020 11:04:21 +02:00
> > > > Committer:     Ingo Molnar <mingo@...nel.org>
> > > > CommitterDate: Fri, 09 Oct 2020 08:53:30 +02:00
> > > > 
> > > > lockdep: Fix lockdep recursion
> > > > 
> > > > Steve reported that lockdep_assert*irq*(), when nested inside lockdep
> > > > itself, will trigger a false-positive.
> > > > 
> > > > One example is the stack-trace code, as called from inside lockdep,
> > > > triggering tracing, which in turn calls RCU, which then uses
> > > > lockdep_assert_irqs_disabled().
> > > > 
> > > > Fixes: a21ee6055c30 ("lockdep: Change hardirq{s_enabled,_context} to per-
> > > > cpu
> > > > variables")
> > > > Reported-by: Steven Rostedt <rostedt@...dmis.org>
> > > > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > > > Signed-off-by: Ingo Molnar <mingo@...nel.org>
> > > 
> > > Reverting this linux-next commit fixed booting RCU-list warnings everywhere.
> > 
> > Is it possible that the RCU-list warnings were being wrongly suppressed
> > without a21ee6055c30?  As in are you certain that these RCU-list warnings
> > are in fact false positives?
> 
> I guess you mean this commit a046a86082cc ("lockdep: Fix lockdep recursion")
> instead of a21ee6055c30. It is unclear to me how that commit a046a86082cc would
> suddenly start to generate those warnings, although I can see it starts to use
> percpu variables even though the CPU is not yet set online.
> 
> DECLARE_PER_CPU(unsigned int, lockdep_recursion);
> 
> Anyway, the problem is that when we in the early boot:
> 
> start_secondary()
>   smp_init_secondary()
>     init_cpu_timer()
>       clockevents_register_device()
> 
> We are taking a lock there but the CPU is not yet online, and the
> __lock_acquire() would call things like hlist_for_each_entry_rcu() from
> lookup_chain_cache() or register_lock_class(). Thus, triggering the RCU-list
> from an offline CPU warnings.
> 
> I am not entirely sure how to fix those though.

One approach is to move the call to rcu_cpu_starting() earlier in the
start_secondary() processing.  It is OK to invoke rcu_cpu_starting()
multiple times, so for experiemental purposes you should be able to add
a new call to it just before that lock is acquired.

							Thanx, Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ