Skip to content

Commit

Permalink
Squashfs: check page size is not larger than the filesystem block size
Browse files Browse the repository at this point in the history
Normally the block size (by default 128K) will be larger than the
page size, unless a non-standard block size has been specified in
Mksquashfs, and the page size is larger than 4K.

Signed-off-by: Phillip Lougher <[email protected]>
  • Loading branch information
Phillip Lougher committed May 13, 2009
1 parent a37b06d commit fffb47b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fs/squashfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,16 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
if (msblk->block_size > SQUASHFS_FILE_MAX_SIZE)
goto failed_mount;

/*
* Check the system page size is not larger than the filesystem
* block size (by default 128K). This is currently not supported.
*/
if (PAGE_CACHE_SIZE > msblk->block_size) {
ERROR("Page size > filesystem block size (%d). This is "
"currently not supported!\n", msblk->block_size);
goto failed_mount;
}

msblk->block_log = le16_to_cpu(sblk->block_log);
if (msblk->block_log > SQUASHFS_FILE_MAX_LOG)
goto failed_mount;
Expand Down

0 comments on commit fffb47b

Please sign in to comment.