]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Nov 2024 15:25:53 +0000 (16:25 +0100)
[ Upstream commit 03b097099eef255fbf85ea6a786ae3c91b11f041 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ntfs3/namei.c

index bff1934e044e5e998c3b4884b27f33b6eb50009f..c1bce9d656cff3e73b766b10c7f1c7359c1006a0 100644 (file)
@@ -79,7 +79,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);
                }