diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-09-24 22:52:31 -0700 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-09-24 22:52:31 -0700 |
commit | 0810a1c64f504d9b272196337a7a2e39872b56d8 (patch) | |
tree | 0b8310deaad1b1a2fba43d3c671a2d30cf5e1fa9 /fs/nilfs2/the_nilfs.c | |
parent | d886b82d2cc23b69aa1cc29a54cc77cf79f430e5 (diff) | |
parent | b52c9082f2eb3a6f7fbbc86fad3eaa2a1725da66 (diff) |
Merge remote-tracking branch 'lts/linux-4.4.y' into v4.4/topic/optee
Diffstat (limited to 'fs/nilfs2/the_nilfs.c')
-rw-r--r-- | fs/nilfs2/the_nilfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index 69bd801afb53..37e49cb2ac4c 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/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); |