Commit cc37f75a authored by Phillip Lougher's avatar Phillip Lougher

Squashfs: fix mount time sanity check for corrupted superblock

A Squashfs filesystem containing nothing but an empty directory,
although unusual and ultimately pointless, is still valid.

The directory_table >= next_table sanity check rejects these
filesystems as invalid because the directory_table is empty and
equal to next_table.
Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
parent d7fbd893
......@@ -290,7 +290,7 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
check_directory_table:
/* Sanity check directory_table */
if (msblk->directory_table >= next_table) {
if (msblk->directory_table > next_table) {
err = -EINVAL;
goto failed_mount;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment