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] [day] [month] [year] [list]
Date:   Thu, 13 Jul 2023 15:15:01 +0200
From:   Christian Brauner <brauner@...nel.org>
To:     Wang Ming <machel@...o.com>
Cc:     Alexander Viro <viro@...iv.linux.org.uk>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        opensource.kernel@...o.com
Subject: Re: [PATCH v1] fs: Fix error checking for d_hash_and_lookup()

On Thu, Jul 13, 2023 at 07:05:00PM +0800, Wang Ming wrote:
> In case of failure, debugfs_create_dir() returns NULL or an error

What on earth does debugfs_create_dir() have to do with this?

> pointer. Most incorrect error checks were fixed, but the one in
> d_add_ci() was forgotten.
> 
> Fixes: d9171b934526 ("parallel lookups machinery, part 4 (and last)")
> Signed-off-by: Wang Ming <machel@...o.com>
> ---
>  fs/dcache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/dcache.c b/fs/dcache.c
> index 52e6d5fdab6b..2f03e275d2e0 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -2220,7 +2220,7 @@ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
>  	 * if not go ahead and create it now.
>  	 */
>  	found = d_hash_and_lookup(dentry->d_parent, name);
> -	if (found) {
> +	if (!IS_ERR_OR_NULL(found)) {

I don't understand.

If d_hash_and_lookup() fails due to custom hash function failure then
the old code bubbles that upwards. You're changing that so that it now
adds a new dentry under the generic hash. That can't possibly be correct.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ