Commit 1585d8d8 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: add check for wraparound in ext4_data_block_valid()

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 6eebee62
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment