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: <467d9b9b-34b4-4a94-95c1-1d41f0a91e05@web.de>
Date: Mon, 26 Aug 2024 15:55:44 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Baokun Li <libaokun1@...wei.com>, netfs@...ts.linux.dev,
 linux-fsdevel@...r.kernel.org, linux-erofs@...ts.ozlabs.org,
 David Howells <dhowells@...hat.com>, Jeff Layton <jlayton@...nel.org>
Cc: stable@...nel.org, LKML <linux-kernel@...r.kernel.org>,
 Christian Brauner <brauner@...nel.org>,
 Gao Xiang <hsiangkao@...ux.alibaba.com>, Hou Tao <houtao1@...wei.com>,
 Jingbo Xu <jefflexu@...ux.alibaba.com>, Yang Erkun <yangerkun@...wei.com>,
 Yu Kuai <yukuai3@...wei.com>, Zizhi Wo <wozizhi@...wei.com>
Subject: Re: [PATCH] cachefiles: fix dentry leak in cachefiles_open_file()

…
> Add the missing dput() to cachefiles_open_file() for a quick fix.

I suggest to use a goto chain accordingly.


…
> +++ b/fs/cachefiles/namei.c
> @@ -554,6 +554,7 @@ static bool cachefiles_open_file(struct cachefiles_object *object,
>  	if (!cachefiles_mark_inode_in_use(object, d_inode(dentry))) {
>  		pr_notice("cachefiles: Inode already in use: %pd (B=%lx)\n",
>  			  dentry, d_inode(dentry)->i_ino);
> +		dput(dentry);
>  		return false;

Please replace two statements by the statement “goto put_dentry;”.


…
> error:
> 	cachefiles_do_unmark_inode_in_use(object, d_inode(dentry));
+put_dentry:
> 	dput(dentry);
> 	return false;
> }

Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ