Commit 5f245791 authored by Konstantin Komarov's avatar Konstantin Komarov Committed by Zizhi Wo
Browse files

fs/ntfs3: Fix possible deadlock in mi_read

stable inclusion
from stable-v5.15.171
commit 47e8a17491e37df53743bc2e72309f8f0d6224af
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB37AB
CVE: CVE-2024-50245

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=47e8a17491e37df53743bc2e72309f8f0d6224af



-------------------------------------------------

[ Upstream commit 03b097099eef255fbf85ea6a786ae3c91b11f041 ]

Mutex lock with another subclass used in ni_lock_dir().

Fixes: 374d4c9c ("fs/ntfs3: Add file operations and implementation")
Reported-by: default avatar <syzbot+bc7ca0ae4591cb2550f9@syzkaller.appspotmail.com>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZizhi Wo <wozizhi@huawei.com>
parent 53677a49
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
		}