]> git.ipfire.org Git - thirdparty/linux.git/commit
efivarfs: use I_MUTEX_CHILD nested lock to traverse variables on resume
authorArd Biesheuvel <ardb@kernel.org>
Mon, 17 Mar 2025 07:23:11 +0000 (08:23 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Mon, 17 Mar 2025 17:19:02 +0000 (18:19 +0100)
commitdec1277875a5974413068bfb67df7e87e51a189b
tree76c2fc5a217054ec4877cd55296bc34306b755ba
parentcb16dfed0093217a68c0faa9394fa5823927e04c
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>
fs/efivarfs/super.c