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: <tencent_938637BC4BA674C576F366443D5336109609@qq.com>
Date: Wed, 13 Mar 2024 21:07:00 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+9b5ec5ccf7234cc6cb86@...kaller.appspotmail.com
Cc: brauner@...nel.org,
	jack@...e.cz,
	linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	syzkaller-bugs@...glegroups.com,
	viro@...iv.linux.org.uk
Subject: [PATCH] libfs: fix warning in stashed_dentry_prune

Initialize d_fsdata in advance to avoid warnings when recycling dentry due to
inode allocation failures.

Fixes: 2558e3b23112 ("libfs: add stashed_dentry_prune()")
Reported-and-tested-by: syzbot+9b5ec5ccf7234cc6cb86@...kaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@...com>
---
 fs/libfs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/libfs.c b/fs/libfs.c
index 0d14ae808fcf..67dc503272eb 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -2013,6 +2013,8 @@ static struct dentry *prepare_anon_dentry(struct dentry **stashed,
 	if (!dentry)
 		return ERR_PTR(-ENOMEM);
 
+	/* Store address of location where dentry's supposed to be stashed. */
+	dentry->d_fsdata = stashed;
 	inode = new_inode_pseudo(sb);
 	if (!inode) {
 		dput(dentry);
@@ -2029,9 +2031,6 @@ static struct dentry *prepare_anon_dentry(struct dentry **stashed,
 	WARN_ON_ONCE(!S_ISREG(inode->i_mode));
 	WARN_ON_ONCE(!IS_IMMUTABLE(inode));
 
-	/* Store address of location where dentry's supposed to be stashed. */
-	dentry->d_fsdata = stashed;
-
 	/* @data is now owned by the fs */
 	d_instantiate(dentry, inode);
 	return dentry;
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ