Skip to content

Commit 345a5c4

Browse files
committed
super: move lockdep assert
Fix braino and move the lockdep assertion after put_super() otherwise we risk a use-after-free. Fixes: 2c18a63 ("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>
1 parent cd4284c commit 345a5c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,8 @@ static bool grab_super_dead(struct super_block *sb)
570570
return true;
571571
}
572572
wait_var_event(&sb->s_flags, wait_dead(sb));
573-
put_super(sb);
574573
lockdep_assert_not_held(&sb->s_umount);
574+
put_super(sb);
575575
return false;
576576
}
577577

0 commit comments

Comments
 (0)