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:52:06 -0400
From:   Waiman Long <longman@...hat.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     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>,
        Oleg Nesterov <oleg@...hat.com>,
        Amir Goldstein <amir73il@...il.com>, Jan Kara <jack@...e.cz>,
        Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v3 1/2] locking/rwsem: Add a new RWSEM_ANONYMOUSLY_OWNED
 flag

On 05/15/2018 01:48 PM, Peter Zijlstra wrote:
> On Tue, May 15, 2018 at 01:38:03PM -0400, Waiman Long wrote:
>> diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
>> index 30465a2..b7208e1 100644
>> --- a/kernel/locking/rwsem.c
>> +++ b/kernel/locking/rwsem.c
>> @@ -130,7 +130,8 @@ void up_read(struct rw_semaphore *sem)
>>  void up_write(struct rw_semaphore *sem)
>>  {
>>  	rwsem_release(&sem->dep_map, 1, _RET_IP_);
>> -	DEBUG_RWSEMS_WARN_ON(sem->owner != current);
>> +	DEBUG_RWSEMS_WARN_ON((sem->owner != current) &&
>> +			     !rwsem_has_anonymous_owner(sem->owner));
> Why? Don't we always do percpu_rwsem_acquire() before up?
>

This is to allow an unlock to happen in the unknown owner state. Yes, it
is not necessary to fix the percpu-rwsem problem. It is there just in
case a rwsem will be released in that state in the future.

Cheers,
Longman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ