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

On Tue, Jun 14, 2022 at 12:08:37PM +1000, Imran Khan wrote:
> +static struct kernfs_open_node *
> +kernfs_deref_open_node(struct kernfs_open_file *of, struct kernfs_node *kn)
> +{
> +	struct kernfs_open_node *on;
> +	bool deref_ok;
> +
> +	deref_ok = (of ? !list_empty(&of->list) : false) ||
> +		   lockdep_is_held(&kernfs_open_file_mutex);
> +
> +	on = rcu_dereference_check(kn->attr.open, deref_ok);
> +
> +	return on;
> +}

Hahahaha didn't know they'd be taking two different arguments. Sorry about
the many iterations but it'd probably be better to have two different
versions for the two argument types. Other than that, looks fine to me.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ