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:   Mon, 14 May 2018 11:50:22 +0200
From:   Jan Kara <jack@...e.cz>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Amir Goldstein <amir73il@...il.com>,
        Waiman Long <longman@...hat.com>,
        Ingo Molnar <mingo@...nel.org>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Jan Kara <jack@...e.cz>, Al Viro <viro@...iv.linux.org.uk>
Subject: Re: DEBUG_RWSEMS warning from thaw_super()

On Sun 13-05-18 18:04:04, Oleg Nesterov wrote:
> On 05/13, Amir Goldstein wrote:
> >
> > Since kernel v4.17-rc1 and DEBUG_RWSEMS, I see the
> > warning below after filesystem freeze/thaw.
> >
> > This is a case where one process acquires a bunch of rwsem
> > and another process releases them.
> >
> > To convey this use case to lockdep, freeze_super() calls
> > lockdep_sb_freeze_release() on exit and thaw_super()
> > calls lockdep_sb_freeze_acquire() on entry.
> 
> This was already discussed, but I forgot the result...
> 
> So once again, why we can't simply update percpu_rwsem_acquire() ?
> Or we can check CONFIG_RWSEM_SPIN_ON_OWNER to match percpu_rwsem_release(),
> but CONFIG_DEBUG_RWSEMS explains the purpose better.

Yeah, what you suggests seems reasonable to me. So feel free to add:

Acked-by: Jan Kara <jack@...e.cz>
	
								Honza

> --- x/include/linux/percpu-rwsem.h
> +++ x/include/linux/percpu-rwsem.h
> @@ -141,6 +141,10 @@ static inline void percpu_rwsem_acquire(
>  					bool read, unsigned long ip)
>  {
>  	lock_acquire(&sem->rw_sem.dep_map, 0, 1, read, 1, NULL, ip);
> +#ifdef CONFIG_DEBUG_RWSEMS
> +	if (!read)
> +		sem->rw_sem.owner = current;
> +#endif
>  }
>  
>  #endif
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ