Skip to content

Commit

Permalink
Squashfs: fix mount time sanity check for corrupted superblock
Browse files Browse the repository at this point in the history
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: Phillip Lougher <phillip@squashfs.org.uk>
  • Loading branch information
Phillip Lougher committed Jan 2, 2012
1 parent d7fbd89 commit cc37f75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/squashfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cc37f75

Please sign in to comment.