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:   Tue, 15 May 2018 13:51:12 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Waiman Long <longman@...hat.com>, Ingo Molnar <mingo@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        Davidlohr Bueso <dave@...olabs.net>,
        "Theodore Y. Ts'o" <tytso@....edu>,
        Amir Goldstein <amir73il@...il.com>, Jan Kara <jack@...e.cz>
Subject: Re: [RFC PATCH v2 2/2] locking/percpu-rwsem: Mark rwsem as
 non-spinnable in percpu_rwsem_release()

On Tue, May 15, 2018 at 01:06:33PM +0200, Oleg Nesterov wrote:
> On 05/15, Peter Zijlstra wrote:
> >
> > So what's wrong with adding:
> >
> > 	if (!read)
> > 		sem->rw_sem.owner = current;
> 
> Agreed, I have already suggested this change twice. Except we obviously
> need to check CONFIG_RWSEM_SPIN_ON_OWNER (->owner doesn't exists otherwise)
> or even CONFIG_DEBUG_RWSEMS to make the purpose more clear.

Right, details ;-)

> > Afaict the whole .owner=NULL thing in release already stops the spinners
> 
> Not really, the new writer will spin in this case, afaics.
> 
> But this is another problem and probably we do not care. The new writer is
> almost impossible in this particular case, another freeze_super() should
> notice frozen != SB_UNFROZEN and return EBUSY.

rwsem_spin_on_owner() checks rwsem_owner_is_writer(), which does owner
&& owner != RWSEM_READER_OWNED, which will fail for !owner.

Or am I completely confused again?

> > and the above 'fixes' the debug splat.
> 
> Yes.
> 
> Waiman, can't we trivially fix the problem first? Then we can add the helpers
> and think about other improvements.

It is really simple; we're not going to add public (and EXPORT'ed to
boot) interfaces to rwsem for this.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ