mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
super: move lockdep assert
Fix braino and move the lockdep assertion after put_super() otherwise we
risk a use-after-free.
Fixes: 2c18a63b76
("super: wait until we passed kill super")
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Message-Id: <20230828-vfs-super-fixes-v1-1-b37a4a04a88f@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
cd4284cfd3
commit
345a5c4a0b
@ -570,8 +570,8 @@ static bool grab_super_dead(struct super_block *sb)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
wait_var_event(&sb->s_flags, wait_dead(sb));
|
wait_var_event(&sb->s_flags, wait_dead(sb));
|
||||||
put_super(sb);
|
|
||||||
lockdep_assert_not_held(&sb->s_umount);
|
lockdep_assert_not_held(&sb->s_umount);
|
||||||
|
put_super(sb);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user