+ ecryptfs-file-operations-fix-premature-release-of-file_info-memory.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     ecryptfs: fix premature release of file_info memory

has been added to the -mm tree.  Its filename is

     ecryptfs-file-operations-fix-premature-release-of-file_info-memory.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: ecryptfs: fix premature release of file_info memory
From: Michael Halcrow <mhalcrow@xxxxxxxxxx>


The file_info struct is being released, and then one of its members is
referenced from the released memory.  This patch cleans up the function and
moves the release so that it occurs after the reference.

Signed-off-by: Michael Halcrow <mhalcrow@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/ecryptfs/file.c |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff -puN fs/ecryptfs/file.c~ecryptfs-file-operations-fix-premature-release-of-file_info-memory fs/ecryptfs/file.c
--- devel/fs/ecryptfs/file.c~ecryptfs-file-operations-fix-premature-release-of-file_info-memory	2006-05-30 17:48:13.000000000 -0700
+++ devel-akpm/fs/ecryptfs/file.c	2006-05-30 17:48:13.000000000 -0700
@@ -304,18 +304,15 @@ static int ecryptfs_flush(struct file *f
 	return rc;
 }
 
-static int ecryptfs_release(struct inode *ecryptfs_inode, struct file *file)
+static int ecryptfs_release(struct inode *inode, struct file *file)
 {
-	struct file *lower_file;
-	struct ecryptfs_file_info *file_info;
-	struct inode *lower_inode;
+	struct file *lower_file = ecryptfs_file_to_lower(file);
+	struct ecryptfs_file_info *file_info = ecryptfs_file_to_private(file);
+	struct inode *lower_inode = ecryptfs_inode_to_lower(inode);
 
-	file_info = ecryptfs_file_to_private(file);
-	kmem_cache_free(ecryptfs_file_info_cache, file_info);
-	lower_file = ecryptfs_file_to_lower(file);
 	fput(lower_file);
-	lower_inode = ecryptfs_inode_to_lower(ecryptfs_inode);
-	ecryptfs_inode->i_blocks = lower_inode->i_blocks;
+	inode->i_blocks = lower_inode->i_blocks;
+	kmem_cache_free(ecryptfs_file_info_cache, file_info);
 	return 0;
 }
 
_

Patches currently in -mm which might be from mhalcrow@xxxxxxxxxx are

ecryptfs-fs-makefile-and-fs-kconfig.patch
ecryptfs-fs-makefile-and-fs-kconfig-remove-ecrypt_debug-from-fs-kconfig.patch
ecryptfs-documentation.patch
ecryptfs-makefile.patch
ecryptfs-main-module-functions.patch
ecryptfs-main-module-functions-uint16_t-u16.patch
ecryptfs-header-declarations.patch
ecryptfs-header-declarations-update.patch
ecryptfs-header-declarations-update-convert-signed-data-types-to-unsigned-data-types.patch
ecryptfs-header-declarations-remove-unnecessary-ifndefs.patch
ecryptfs-superblock-operations.patch
ecryptfs-dentry-operations.patch
ecryptfs-file-operations.patch
ecryptfs-file-operations-remove-null-==-syntax.patch
ecryptfs-file-operations-remove-extraneous-read-of-inode-size-from-header.patch
ecryptfs-file-operations-fix.patch
ecryptfs-file-operations-fix-premature-release-of-file_info-memory.patch
ecryptfs-inode-operations.patch
ecryptfs-mmap-operations.patch
mark-address_space_operations-const-vs-ecryptfs-mmap-operations.patch
ecryptfs-keystore.patch
ecryptfs-crypto-functions.patch
ecryptfs-debug-functions.patch
ecryptfs-alpha-build-fix.patch
ecryptfs-convert-assert-to-bug_on.patch
ecryptfs-remove-unnecessary-null-checks.patch
ecryptfs-rewrite-ecryptfs_fsync.patch
ecryptfs-overhaul-file-locking.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux