aboutsummaryrefslogtreecommitdiffstats
path: root/fs/squashfs
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@squashfs.org.uk>2012-01-02 17:47:14 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-02 09:47:54 -0700
commit9523d5244a925f514e5daf04e5030a68e91f55cd (patch)
tree1ced9fd2e8218b16db51ffb7e89e0637203a6ea0 /fs/squashfs
parentb960ba52595157ae215c4e899e9da99fbc81959a (diff)
downloadkernel_samsung_smdk4412-9523d5244a925f514e5daf04e5030a68e91f55cd.zip
kernel_samsung_smdk4412-9523d5244a925f514e5daf04e5030a68e91f55cd.tar.gz
kernel_samsung_smdk4412-9523d5244a925f514e5daf04e5030a68e91f55cd.tar.bz2
Squashfs: fix mount time sanity check for corrupted superblock
commit cc37f75a9ffbbfcb1c3297534f293c8284e3c5a6 upstream. 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> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 7438850..b5a8636 100644
--- a/fs/squashfs/super.c
+++ b/fs/squashfs/super.c
@@ -290,7 +290,7 @@ handle_fragments:
check_directory_table:
/* Sanity check directory_table */
- if (msblk->directory_table >= next_table) {
+ if (msblk->directory_table > next_table) {
err = -EINVAL;
goto failed_mount;
}