X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Ffs%2Fnilfs2%2Fthe_nilfs.c;fp=kernel%2Ffs%2Fnilfs2%2Fthe_nilfs.c;h=37e49cb2ac4c4a61d61357272a2ee168165bf793;hb=52f993b8e89487ec9ee15a7fb4979e0f09a45b27;hp=69bd801afb53b987ea3fa862fd2a444b41d2efdb;hpb=c189ccac5702322ed843fe17057035b7222a59b6;p=kvmfornfv.git diff --git a/kernel/fs/nilfs2/the_nilfs.c b/kernel/fs/nilfs2/the_nilfs.c index 69bd801af..37e49cb2a 100644 --- a/kernel/fs/nilfs2/the_nilfs.c +++ b/kernel/fs/nilfs2/the_nilfs.c @@ -443,7 +443,7 @@ static int nilfs_valid_sb(struct nilfs_super_block *sbp) if (!sbp || le16_to_cpu(sbp->s_magic) != NILFS_SUPER_MAGIC) return 0; bytes = le16_to_cpu(sbp->s_bytes); - if (bytes > BLOCK_SIZE) + if (bytes < sumoff + 4 || bytes > BLOCK_SIZE) return 0; crc = crc32_le(le32_to_cpu(sbp->s_crc_seed), (unsigned char *)sbp, sumoff);