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: Thu, 1 Feb 2024 13:55:32 -0800
From: Boqun Feng <boqun.feng@...il.com>
To: Bart Van Assche <bvanassche@....org>
Cc: Zhiguo Niu <zhiguo.niu@...soc.com>, peterz@...radead.org,
	mingo@...hat.com, will@...nel.org, longman@...hat.com,
	linux-kernel@...r.kernel.org, niuzhiguo84@...il.com,
	ke.wang@...soc.com, xuewen.yan@...soc.com,
	Carlos Llamas <cmllamas@...gle.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH V2] lockdep: fix deadlock issue between lockdep and rcu

On Thu, Feb 01, 2024 at 01:24:48PM -0800, Bart Van Assche wrote:
> On 2/1/24 11:48, Boqun Feng wrote:
> > raw_spin_lock_irqsave():
> >    lock_acquire():
> >      __lock_acquire():
> >        validate_chain():
> >          lookup_chain_cache_add():
> >            graph_lock();
> > 
> > Basically, every lock acquisition may lock the lockdep graph because
> > of dependency checking.
> 
> Wouldn't it be simpler to make __lock_acquire() return early if
> this_cpu_read(lockdep_recursion) indicates that the graph lock is held?
> 

Note that lockdep_recursion doesn't indicate graph lock is held, it
indicates we enter lockdep internal, which means if there was any lock
acquisition, __lock_acquire() would skip the check, so we don't go into
lockdep internal again, therefore avoid infinite recursion.

Regards,
Boqun

> Thanks,
> 
> Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ