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, 2 Mar 2017 11:52:25 +0900
From:   Byungchul Park <byungchul.park@....com>
To:     Peter Zijlstra <peterz@...radead.org>
CC:     <mingo@...nel.org>, <tglx@...utronix.de>, <walken@...gle.com>,
        <boqun.feng@...il.com>, <kirill@...temov.name>,
        <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
        <iamjoonsoo.kim@....com>, <akpm@...ux-foundation.org>,
        <npiggin@...il.com>, <kernel-team@....com>
Subject: Re: [PATCH v5 06/13] lockdep: Implement crossrelease feature

On Wed, Mar 01, 2017 at 02:17:07PM +0900, Byungchul Park wrote:
> > > +void lock_commit_crosslock(struct lockdep_map *lock)
> > > +{
> > > +	struct cross_lock *xlock;
> > > +	unsigned long flags;
> > > +
> > > +	if (!current->xhlocks)
> > > +		return;
> > > +
> > > +	if (unlikely(current->lockdep_recursion))
> > > +		return;
> > > +
> > > +	raw_local_irq_save(flags);
> > > +	check_flags(flags);
> > > +	current->lockdep_recursion = 1;
> > > +
> > > +	if (unlikely(!debug_locks))
> > > +		return;
> > > +
> > > +	if (!graph_lock())
> > > +		return;
> > > +
> > > +	xlock = &((struct lockdep_map_cross *)lock)->xlock;
> > > +	if (atomic_read(&xlock->ref) > 0 && !commit_xhlocks(xlock))
> > 
> > You terminate with graph_lock() held.
> 
> Oops. What did I do? I'll fix it.

I remembered it. It's no problem because it would terminate there, only
if _both_ 'xlock->ref > 0' and 'commit_xhlocks returns 0' are true.
Otherwise, it will unlock the lock safely.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ