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.10-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.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From e159332b9af4b04d882dbcfe1bb0117f0a6d4b58 Mon Sep 17 00:00:00 2001
From: Jan Kara <[email protected]>
Date: Fri, 19 Dec 2014 12:03:53 +0100
Subject: udf: Verify i_size when loading inode
From: Jan Kara <[email protected]>
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 <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
fs/udf/inode.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -1495,6 +1495,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 [email protected] are
queue-3.10/isofs-fix-infinite-looping-over-ce-entries.patch
queue-3.10/ncpfs-return-proper-error-from-ncp_ioc_setroot-ioctl.patch
queue-3.10/udf-verify-i_size-when-loading-inode.patch
queue-3.10/udf-check-component-length-before-reading-it.patch
queue-3.10/udf-verify-symlink-size-before-loading-it.patch
queue-3.10/isofs-fix-unchecked-printing-of-er-records.patch
queue-3.10/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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html