Squashfs: fix corruption checks in squashfs_readdir()
authorPhillip Lougher <phillip@squashfs.org.uk>
Tue, 3 Sep 2013 03:38:43 +0000 (04:38 +0100)
committerMohamad Ayyash <mkayyash@google.com>
Wed, 4 Mar 2015 19:21:38 +0000 (11:21 -0800)
commit4ff8d316da73165acdda9682ac0413b2a141c6d6
treefaf108800305088012b47462584da6c482a93b83
parent98bdbcf71ac52afdbf832489c6077790689c9018
Squashfs: fix corruption checks in squashfs_readdir()

The dir_count and size fields when read from disk are sanity
checked for correctness.  However, the sanity checks only check the
values are not greater than expected.  As dir_count and size were
incorrectly defined as signed ints, this can lead to corrupted values
appearing as negative which are not trapped.

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
fs/squashfs/dir.c