Skip to content

Commit fffb47b

Browse files
author
Phillip Lougher
committed
Squashfs: check page size is not larger than the filesystem block size
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]>
1 parent a37b06d commit fffb47b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fs/squashfs/super.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
157157
if (msblk->block_size > SQUASHFS_FILE_MAX_SIZE)
158158
goto failed_mount;
159159

160+
/*
161+
* Check the system page size is not larger than the filesystem
162+
* block size (by default 128K). This is currently not supported.
163+
*/
164+
if (PAGE_CACHE_SIZE > msblk->block_size) {
165+
ERROR("Page size > filesystem block size (%d). This is "
166+
"currently not supported!\n", msblk->block_size);
167+
goto failed_mount;
168+
}
169+
160170
msblk->block_log = le16_to_cpu(sblk->block_log);
161171
if (msblk->block_log > SQUASHFS_FILE_MAX_LOG)
162172
goto failed_mount;

0 commit comments

Comments
 (0)