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:   Wed, 9 Dec 2020 20:35:00 +0000
From:   Al Viro <viro@...iv.linux.org.uk>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     LKML <linux-kernel@...r.kernel.org>, linux-fsdevel@...r.kernel.org
Subject: Re: fs/namei.c: Make status likely to be ECHILD in lookup_fast()

On Wed, Dec 09, 2020 at 03:24:03PM -0500, Steven Rostedt wrote:
> From:  Steven Rostedt (VMware) <rostedt@...dmis.org>
> 
> Running my yearly branch profiling code, it detected a 100% wrong branch
> condition in name.c for lookup_fast(). The code in question has:
> 
> 		status = d_revalidate(dentry, nd->flags);
> 		if (likely(status > 0))
> 			return dentry;
> 		if (unlazy_child(nd, dentry, seq))
> 			return ERR_PTR(-ECHILD);
> 		if (unlikely(status == -ECHILD))
> 			/* we'd been told to redo it in non-rcu mode */
> 			status = d_revalidate(dentry, nd->flags);
> 
> If the status of the d_revalidate() is greater than zero, then the function
> finishes. Otherwise, if it is an "unlazy_child" it returns with -ECHILD.
> After the above two checks, the status is compared to -ECHILD, as that is
> what is returned if the original d_revalidate() needed to be done in a
> non-rcu mode.
> 
> Especially this path is called in a condition of:
> 
> 	if (nd->flags & LOOKUP_RCU) {
> 
> And most of the d_revalidate() functions have:
> 
> 	if (flags & LOOKUP_RCU)
> 		return -ECHILD;

Umm...  That depends upon the filesystem mix involved; said that, I'd rather
drop that "unlikely"...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ