Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+1 -1
+1 -1
fs/squashfs/super.c
··· 290 290 291 291 check_directory_table: 292 292 /* Sanity check directory_table */ 293 - if (msblk->directory_table >= next_table) { 293 + if (msblk->directory_table > next_table) { 294 294 err = -EINVAL; 295 295 goto failed_mount; 296 296 }