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, 13 Jun 2022 07:30:32 -1000
From:   Tejun Heo <tj@...nel.org>
To:     Imran Khan <imran.f.khan@...cle.com>
Cc:     viro@...iv.linux.org.uk, gregkh@...uxfoundation.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND v4 1/4] kernfs: make ->attr.open RCU protected.

On Mon, Jun 13, 2022 at 01:56:43PM +1000, Imran Khan wrote:
> Agree. I did over think this and went for the safest interface that I could
> think of in each of the use cases. I will remove
> kernfs_check_open_node_protected and use kernfs_deref_open_node_protected in its
> place as well. This will cover all accesses under kernfs_open_file_mutex.
> 
> But we will still need kernfs_deref_open_node for cases where
> !list_empty(&of->list) ensures safe access of ->attr.open and where we can't
> ensure holding of kernfs_open_file_mutex. So we will need 2 deref accessors.
> Right? Just asking this because you mentioned above to come up with one deref
> accessor that can be used in all three use cases
> 
> Please let me if this sounds okay. I can send updated patch-set with these
> changes in place.

Just merge all three into one accessor. You can list both the !list_empty
condition and lock held conditions on the same rcu_dereference_check() call.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ