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]
Message-ID: <YKHvUkxpytzSewEC@boqun-archlinux>
Date:   Mon, 17 May 2021 12:21:38 +0800
From:   Boqun Feng <boqun.feng@...il.com>
To:     Joel Fernandes <joelaf@...gle.com>
Cc:     "Joel Fernandes (Google)" <joel@...lfernandes.org>,
        Peter Zijlstra <peterz@...radead.org>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Laurent Dufour <ldufour@...ux.ibm.com>,
        Suren Baghdasaryan <surenb@...gle.com>
Subject: Re: Silencing false lockdep warning related to seq lock

Hi,

On Fri, May 14, 2021 at 10:52:31AM -0400, Joel Fernandes wrote:
> Hi Boqun,
> You might have worked on such issues so I thought you're a good person to ask.
> 
> After apply Laurent's SPF patchset [1] , we're facing a large number
> of (seemingly false positive) lockdep reports which are related to
> circular dependencies with seq locks.
> 
>  lock(A); write_seqcount(B)
>   vs.
> write_seqcount(B); lock(A)
> 

Two questions here:

*	Could you provide the lockdep splats you saw? I wonder whether
	it's similar to the one mentioned in patch #9[1].

*	What keeps write_seqcount(vm_seqcount) serialized? If it's only
	one lock that serializes the writers, we probably can make it
	as the nest_lock argument for seqcount_acquire(), and that will
	help prevent the false positives.

Regards,
Boqun

[1]: https://lore.kernel.org/lkml/20190416134522.17540-10-ldufour@linux.ibm.com/

> This cannot deadlock obviously. My current strategy which I hate is to
> make it a raw seqcount write which bypasses lockdep. That's horrible
> for obvious reasons. Do you have any tricks/patches up your sleeve to
> silence these?
> 
> I suppose we still want to catch lockdep issues of the form (which
> peterz chatted to me about):
> 
>  lock(A); write_seqcount(B)
>   vs.
> read_seqcount(B); lock(A)
> 
> which seems like it can deadlock.
> 
> I would rather make lockdep useful to catch these and not miss out on
> them. Let me know what you think?
> 
> Cheers,
> -Joel
> 
> [1] https://lkml.org/lkml/2019/4/16/615

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ