diff options
author | Mark Brown <broonie@kernel.org> | 2015-01-07 17:30:17 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-07 17:30:17 +0000 |
commit | 1285c3fefaddedf5358f52cfde3c2b64d8086a04 (patch) | |
tree | 361f556d6b400e8cb6d16738142db2f69f63ef2f /fs/udf/inode.c | |
parent | 6b038c8d2b99b552f0b025c8a134f8a3c417a3e7 (diff) | |
parent | b1940cd21c0f4abdce101253e860feff547291b0 (diff) |
Merge tag 'v3.19-rc3' into spi-sh-msiof
Linux 3.19-rc3
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r-- | fs/udf/inode.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index c9b4df5810d5..5bc71d9a674a 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1489,6 +1489,20 @@ reread: } inode->i_generation = iinfo->i_unique; + /* Sanity checks for files in ICB so that we don't get confused later */ + if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { + /* + * For file in ICB data is stored in allocation descriptor + * so sizes should match + */ + if (iinfo->i_lenAlloc != inode->i_size) + goto out; + /* File in ICB has to fit in there... */ + if (inode->i_size > inode->i_sb->s_blocksize - + udf_file_entry_alloc_offset(inode)) + goto out; + } + switch (fe->icbTag.fileType) { case ICBTAG_FILE_TYPE_DIRECTORY: inode->i_op = &udf_dir_inode_operations; |