aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@squashfs.org.uk>2013-09-03 04:02:53 +0100
committerMohamad Ayyash <mkayyash@google.com>2015-03-04 11:20:43 -0800
commitedd2496ccf4a46cfb4c2d20ff9b93ab29b055e1b (patch)
treecc40fa06dedebe0fe129b34b0748458ffe33ef3e /fs
parent706a7943a802fedc861d39598a4399999209e341 (diff)
Squashfs: fix corruption check in get_dir_index_using_name()
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/squashfs/namei.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/squashfs/namei.c b/fs/squashfs/namei.c
index f866d42a8b6f..342a5aa5a0e4 100644
--- a/fs/squashfs/namei.c
+++ b/fs/squashfs/namei.c
@@ -104,10 +104,8 @@ static int get_dir_index_using_name(struct super_block *sb,
size = le32_to_cpu(index->size) + 1;
- if (size > SQUASHFS_NAME_LEN) {
- err = -EINVAL;
+ if (size > SQUASHFS_NAME_LEN)
break;
- }
err = squashfs_read_metadata(sb, index->name, &index_start,
&index_offset, size);