projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
drm/rockchip: add support for src1
[firefly-linux-kernel-4.4.55.git]
/
fs
/
ext4
/
balloc.c
diff --git
a/fs/ext4/balloc.c
b/fs/ext4/balloc.c
index fe1f50fe764ff9238354e2e30491c6e1e6d149b9..f97110461c196b2b770baa7d2e0b7694cb750fa2 100644
(file)
--- a/
fs/ext4/balloc.c
+++ b/
fs/ext4/balloc.c
@@
-208,6
+208,9
@@
static int ext4_init_block_bitmap(struct super_block *sb,
memset(bh->b_data, 0, sb->s_blocksize);
bit_max = ext4_num_base_meta_clusters(sb, block_group);
+ if ((bit_max >> 3) >= bh->b_size)
+ return -EFSCORRUPTED;
+
for (bit = 0; bit < bit_max; bit++)
ext4_set_bit(bit, bh->b_data);