This is a note to let you know that I've just added the patch titled udf: Verify i_size when loading inode to the 3.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: udf-verify-i_size-when-loading-inode.patch and it can be found in the queue-3.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From e159332b9af4b04d882dbcfe1bb0117f0a6d4b58 Mon Sep 17 00:00:00 2001 From: Jan Kara <jack@xxxxxxx> Date: Fri, 19 Dec 2014 12:03:53 +0100 Subject: udf: Verify i_size when loading inode From: Jan Kara <jack@xxxxxxx> commit e159332b9af4b04d882dbcfe1bb0117f0a6d4b58 upstream. Verify that inode size is sane when loading inode with data stored in ICB. Otherwise we may get confused later when working with the inode and inode size is too big. Reported-by: Carl Henrik Lunde <chlunde@xxxxxxxxxxx> Signed-off-by: Jan Kara <jack@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/udf/inode.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1496,6 +1496,20 @@ static void udf_fill_inode(struct inode iinfo->i_checkpoint = le32_to_cpu(efe->checkpoint); } + /* 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; Patches currently in stable-queue which might be from jack@xxxxxxx are queue-3.14/isofs-fix-infinite-looping-over-ce-entries.patch queue-3.14/ncpfs-return-proper-error-from-ncp_ioc_setroot-ioctl.patch queue-3.14/udf-verify-i_size-when-loading-inode.patch queue-3.14/udf-check-component-length-before-reading-it.patch queue-3.14/udf-verify-symlink-size-before-loading-it.patch queue-3.14/isofs-fix-unchecked-printing-of-er-records.patch queue-3.14/udf-check-path-length-when-reading-symlink.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html