Skip to content

Commit

Permalink
super: move lockdep assert
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Brauner committed Aug 29, 2023
1 parent cd4284c commit 345a5c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ static bool grab_super_dead(struct super_block *sb)
return true;
}
wait_var_event(&sb->s_flags, wait_dead(sb));
put_super(sb);
lockdep_assert_not_held(&sb->s_umount);
put_super(sb);
return false;
}

Expand Down

0 comments on commit 345a5c4

Please sign in to comment.