[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_5C66A03CF936689664374C4A0A754B765709@qq.com>
Date: Tue, 17 Jun 2025 20:46:58 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+1aa90f0eb1fc3e77d969@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [ntfs3?] general protection fault in pick_link (2)
#syz test
diff --git a/fs/namei.c b/fs/namei.c
index f761cafaeaad..5b8a69d882d1 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2005,6 +2005,10 @@ static const char *step_into(struct nameidata *nd, int flags,
if (path.mnt == nd->path.mnt)
mntget(path.mnt);
}
+
+ if (inode && is_bad_inode(inode))
+ return NULL;
+
return pick_link(nd, &path, inode, flags);
}
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 756e1306fe6c..10006241fa8e 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -3027,8 +3027,10 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
err = ni_add_name(new_dir_ni, ni, new_de);
if (!err) {
err = ni_remove_name(dir_ni, ni, de, &de2, &undo);
- if (err && ni_remove_name(new_dir_ni, ni, new_de, &de2, &undo))
+ if (err) {
+ ni_remove_name(new_dir_ni, ni, new_de, &de2, &undo);
*is_bad = true;
+ }
}
/*
Powered by blists - more mailing lists