aboutsummaryrefslogtreecommitdiff
path: root/fs/squashfs/namei.c
Commit message (Collapse)AuthorAgeFilesLines
* Squashfs: fix corruption checks in squashfs_lookup()Phillip Lougher2017-04-111-1/+2
| | | | | | | | | | | 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> Change-Id: Iadcc635658dcc7dd1ce940cb0537e5ebccca471a
* Squashfs: fix corruption check in get_dir_index_using_name()Phillip Lougher2017-04-111-3/+1
| | | | | | | | | | | | | | | | | Patch "Squashfs: sanity check information from disk" from Dan Carpenter adds a missing check for corruption in the "size" field while reading the directory index from disk. It, however, sets err to -EINVAL, this value is not used later, and so setting it is completely redundant. So remove it. Errors in reading the index are deliberately non-fatal. If we get an error in reading the index we just return the part of the index we have managed to read - the index isn't essential, just quicker. Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk> Change-Id: I846f6cccb98ff0f5d576983214ff964507f4376a
* Squashfs: sanity check information from diskDan Carpenter2017-04-111-1/+6
| | | | | | | | | We read the size of the name from the disk, but a larger name than expected would cause memory corruption. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk> Change-Id: Ia307b9c023bf1c7c024bb1d90302aea527b66997
* first commitMeizu OpenSource2016-08-151-0/+248