diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2013-09-02 23:02:53 -0400 |
---|---|---|
committer | Phillip Lougher <phillip@squashfs.org.uk> | 2013-09-05 23:57:52 -0400 |
commit | 9dbc41d5d371cb10099c8182552f3915920e69b6 (patch) | |
tree | fa549b1308a13d40f8de494889dc9d315eea894b /fs/squashfs | |
parent | e0125262a2f5cefbfb3804117f8ab16e9ba13e29 (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/squashfs')
-rw-r--r-- | fs/squashfs/namei.c | 4 |
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, | |||
104 | 104 | ||
105 | 105 | ||
106 | size = le32_to_cpu(index->size) + 1; | 106 | size = le32_to_cpu(index->size) + 1; |
107 | if (size > SQUASHFS_NAME_LEN) { | 107 | if (size > SQUASHFS_NAME_LEN) |
108 | err = -EINVAL; | ||
109 | break; | 108 | break; |
110 | } | ||
111 | 109 | ||
112 | err = squashfs_read_metadata(sb, index->name, &index_start, | 110 | err = squashfs_read_metadata(sb, index->name, &index_start, |
113 | &index_offset, size); | 111 | &index_offset, size); |