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: <X8feIjdsi6xlGLv6@mtj.duckdns.org>
Date:   Wed, 2 Dec 2020 13:34:10 -0500
From:   Tejun Heo <tj@...nel.org>
To:     Fox Chen <foxhlchen@...il.com>
Cc:     gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] kernfs: replace the mutex in kernfs_iop_permission
 with a rwlock

Hello,

On Wed, Dec 02, 2020 at 10:58:36PM +0800, Fox Chen wrote:
> @@ -121,7 +121,7 @@ int kernfs_iop_setattr(struct dentry *dentry, struct iattr *iattr)
>  	if (!kn)
>  		return -EINVAL;
>  
> -	mutex_lock(&kernfs_mutex);
> +	write_lock(&kn->iattr_rwlock);
>  	error = setattr_prepare(dentry, iattr);
>  	if (error)
>  		goto out;
> @@ -134,7 +134,7 @@ int kernfs_iop_setattr(struct dentry *dentry, struct iattr *iattr)
>  	setattr_copy(inode, iattr);
>  
>  out:
> -	mutex_unlock(&kernfs_mutex);
> +	write_unlock(&kn->iattr_rwlock);
>  	return error;
>  }

This is putting GFP_KERNEL allocation inside a rwlock. Can you please test
with debug options including LOCKDEP and DEBUG_ATOMIC_SLEEP turned on?

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ