Re: [syzbot] possible fix (linux-ntfs3)
From: syzbot
Date: Mon Sep 02 2024 - 09:17:47 EST
For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx.
***
Subject: possible fix (linux-ntfs3)
Author: almaz.alexandrovich@xxxxxxxxxxxxxxxxxxxx
#syz test: https://github.com/Paragon-Software-Group/linux-ntfs3.git master
diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c
index fc720ad9c57a..aa7e9d70e32e 100644
--- a/fs/ntfs3/namei.c
+++ b/fs/ntfs3/namei.c
@@ -81,7 +81,7 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,
if (err < 0)
inode = ERR_PTR(err);
else {
- ni_lock(ni);
+ ni_lock_dir(ni);
inode = dir_search_u(dir, uni, NULL);
ni_unlock(ni);
}