Skip to content

Commit

Permalink
ext4: add check for wraparound in ext4_data_block_valid()
Browse files Browse the repository at this point in the history
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Theodore Ts'o committed Nov 23, 2009
1 parent 6eebee6 commit 1585d8d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext4/block_validity.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ int ext4_data_block_valid(struct ext4_sb_info *sbi, ext4_fsblk_t start_blk,
struct rb_node *n = sbi->system_blks.rb_node;

if ((start_blk <= le32_to_cpu(sbi->s_es->s_first_data_block)) ||
(start_blk + count < start_blk) ||
(start_blk + count > ext4_blocks_count(sbi->s_es)))
return 0;
while (n) {
Expand Down

0 comments on commit 1585d8d

Please sign in to comment.