Re: [syzbot] [efi?] [fs?] possible deadlock in efivarfs_actor

Al Viro
2025-03-10T23:25:33Z

On Mon, Mar 10, 2025 at 07:24:43PM +0100, Ard Biesheuvel wrote:

> And one of the other logs has
>
> [ 47.650966][ T6617] syz.2.9/6617 is trying to acquire lock:
> [ 47.652339][ T6617] ffff0000d69f6558
> (&sb->s_type->i_mutex_key#25){++++}-{4:4}, at:
> efivarfs_actor+0x1b8/0x2b8
> [ 47.654943][ T6617]
> [ 47.654943][ T6617] but task is already holding lock:
> [ 47.656931][ T6617] ffff0000f5b84558
> (&sb->s_type->i_mutex_key#25){++++}-{4:4}, at: iterate_dir+0x3b4/0x5f4
>
> where the locks have the same name but the address is different.
>
> So there is something dodgy going on here, and I'm inclined to just ignore it.

That one is a false positive - iterate_dir() locks parent, then
callback locks child, but without bothering to tell lockdep about
that. IOW, in actor you should use inode_lock_nested(inode, INODE_CHILD);
instead of inode_lock(inode).