]> www.infradead.org Git - users/willy/linux.git/commitdiff
fs/ntfs3: Fix possible deadlock in mi_read
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Wed, 28 Aug 2024 08:55:53 +0000 (11:55 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 1 Oct 2024 09:19:06 +0000 (12:19 +0300)
Mutex lock with another subclass used in ni_lock_dir().

Reported-by: syzbot+bc7ca0ae4591cb2550f9@syzkaller.appspotmail.com
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/namei.c

index 4c35262449d7241a92f61048dde19fcd9102bf48..abf7e81584a9b27e1d7c193ffdfab04417e9e75b 100644 (file)
@@ -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);
                }