summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-11-23 01:48:34 (GMT)
committerTheodore Ts'o <tytso@mit.edu>2009-11-23 01:48:34 (GMT)
commit1585d8d89ae1791d8f957731f5655700fbcc5664 (patch)
tree9139a0e5dd10bfee5695e7cb4ca47e7677e5718c /fs/ext4
parent6eebee625544ac4ef1d805da942f463275bd6caa (diff)
downloadlinux-1585d8d89ae1791d8f957731f5655700fbcc5664.tar.xz
ext4: add check for wraparound in ext4_data_block_valid()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/block_validity.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c
index dc79b75..4df8621 100644
--- a/fs/ext4/block_validity.c
+++ b/fs/ext4/block_validity.c
@@ -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) {