aboutsummaryrefslogtreecommitdiff
path: root/fs/super.c
diff options
context:
space:
mode:
authorChristian Brauner2023-08-28 13:26:23 +0200
committerChristian Brauner2023-08-29 10:13:04 +0200
commit345a5c4a0b635fa3fc658e6e0cd7fd2217c667cd (patch)
treebc0a5953fcc34cbecb760c23e2a22fcc945bb42c /fs/super.c
parentcd4284cfd3e11c7a49e4808f76f53284d47d04dd (diff)
super: move lockdep assert
Fix braino and move the lockdep assertion after put_super() otherwise we risk a use-after-free. Fixes: 2c18a63b760a ("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>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/super.c b/fs/super.c
index ef87103e2a51..779247eb219c 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -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;
}