diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 21:05:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 21:05:54 -0400 |
commit | 8563f8786ee389c7861938d1d25336706f6de187 (patch) | |
tree | aba82cbaa5111ec9a55b5e25add4fdb7100f6720 /fs/squashfs/super.c | |
parent | 532bfc851a7475fb6a36c1e953aa395798a7cca7 (diff) | |
parent | 4b0180a49f08dd1c681cdc99edc9e0cec0a833fa (diff) |
Merge tag 'squashfs-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next
Pull squashfs updates from Phillip Lougher:
"Add an extra mount time sanity check, plus some code cleanups and bug
fixes."
* tag 'squashfs-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next:
Squashfs: add mount time sanity check for block_size and block_log match
Squashfs: fix f_pos check in get_dir_index_using_offset
Squashfs: get rid of obsolete definitions in header file
Squashfs: remove redundant length initialisation in squashfs_lookup
Squashfs: remove redundant length initialisation in squashfs_readdir
Squashfs: update comment removing reference to zlib only
Squashfs: use define instead of constant
Diffstat (limited to 'fs/squashfs/super.c')
-rw-r--r-- | fs/squashfs/super.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index 970b1167e7cb..29cd014ed3a1 100644 --- a/fs/squashfs/super.c +++ b/fs/squashfs/super.c | |||
@@ -158,10 +158,15 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent) | |||
158 | goto failed_mount; | 158 | goto failed_mount; |
159 | } | 159 | } |
160 | 160 | ||
161 | /* Check block log for sanity */ | ||
161 | msblk->block_log = le16_to_cpu(sblk->block_log); | 162 | msblk->block_log = le16_to_cpu(sblk->block_log); |
162 | if (msblk->block_log > SQUASHFS_FILE_MAX_LOG) | 163 | if (msblk->block_log > SQUASHFS_FILE_MAX_LOG) |
163 | goto failed_mount; | 164 | goto failed_mount; |
164 | 165 | ||
166 | /* Check that block_size and block_log match */ | ||
167 | if (msblk->block_size != (1 << msblk->block_log)) | ||
168 | goto failed_mount; | ||
169 | |||
165 | /* Check the root inode for sanity */ | 170 | /* Check the root inode for sanity */ |
166 | root_inode = le64_to_cpu(sblk->root_inode); | 171 | root_inode = le64_to_cpu(sblk->root_inode); |
167 | if (SQUASHFS_INODE_OFFSET(root_inode) > SQUASHFS_METADATA_SIZE) | 172 | if (SQUASHFS_INODE_OFFSET(root_inode) > SQUASHFS_METADATA_SIZE) |