Re: [syzbot] possible deadlock in fuse_reverse_inval_entry

From: Miklos Szeredi
Date: Tue Sep 07 2021 - 11:25:12 EST


#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master
From: Miklos Szeredi <mszeredi@xxxxxxxxxx>
Subject: fuse: annotate lock in fuse_reverse_inval_entry()

Add missing inode lock annotatation; found by syzbot.

Reported-by: syzbot+9f747458f5990eaa8d43@xxxxxxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx>
---
fs/fuse/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -1071,7 +1071,7 @@ int fuse_reverse_inval_entry(struct fuse
if (!parent)
return -ENOENT;

- inode_lock(parent);
+ inode_lock_nested(parent, I_MUTEX_PARENT);
if (!S_ISDIR(parent->i_mode))
goto unlock;