Skip to content

Commit 9db9c7d

Browse files
maharmstonekdave
authored andcommitted
btrfs: don't clobber ret in btrfs_validate_super()
Commit 2a9bb78 ("btrfs: validate system chunk array at btrfs_validate_super()") introduces a call to validate_sys_chunk_array() in btrfs_validate_super(), which clobbers the value of ret set earlier. This has the effect of negating the validity checks done earlier, making it so btrfs could potentially try to mount invalid filesystems. Fixes: 2a9bb78 ("btrfs: validate system chunk array at btrfs_validate_super()") Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Mark Harmstone <maharmstone@fb.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 49990d8 commit 9db9c7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/btrfs/disk-io.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,6 +2562,9 @@ int btrfs_validate_super(const struct btrfs_fs_info *fs_info,
25622562
ret = -EINVAL;
25632563
}
25642564

2565+
if (ret)
2566+
return ret;
2567+
25652568
ret = validate_sys_chunk_array(fs_info, sb);
25662569

25672570
/*

0 commit comments

Comments
 (0)