aboutsummaryrefslogtreecommitdiffstats
path: root/fs/squashfs
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@squashfs.org.uk>2012-01-02 12:47:14 -0500
committerPhillip Lougher <phillip@squashfs.org.uk>2012-01-02 12:47:14 -0500
commitcc37f75a9ffbbfcb1c3297534f293c8284e3c5a6 (patch)
treef7cb651315e55e96245ba0495848fd07369a2faf /fs/squashfs
parentd7fbd893388d9e86d29b7cfbd5457bcf03496fbf (diff)
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: Phillip Lougher <phillip@squashfs.org.uk>
Diffstat (limited to 'fs/squashfs')
-rw-r--r--fs/squashfs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c
index 2da1715452ac..4619247d74ed 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -290,7 +290,7 @@ handle_fragments:
290 290
291check_directory_table: 291check_directory_table:
292 /* Sanity check directory_table */ 292 /* Sanity check directory_table */
293 if (msblk->directory_table >= next_table) { 293 if (msblk->directory_table > next_table) {
294 err = -EINVAL; 294 err = -EINVAL;
295 goto failed_mount; 295 goto failed_mount;
296 } 296 }