Skip to content

Commit dec1277

Browse files
committed
efivarfs: use I_MUTEX_CHILD nested lock to traverse variables on resume
syzbot warns about a potential deadlock, but this is a false positive resulting from a missing lockdep annotation: iterate_dir() locks the parent whereas the inode_lock() it warns about locks the child, which is guaranteed to be a different lock. So use inode_lock_nested() instead with the appropriate lock class. Reported-by: syzbot+019072ad24ab1d948228@syzkaller.appspotmail.com Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent cb16dfe commit dec1277

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/efivarfs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ static bool efivarfs_actor(struct dir_context *ctx, const char *name, int len,
421421
if (err)
422422
size = 0;
423423

424-
inode_lock(inode);
424+
inode_lock_nested(inode, I_MUTEX_CHILD);
425425
i_size_write(inode, size);
426426
inode_unlock(inode);
427427

0 commit comments

Comments
 (0)