[linux] 01/03: ecryptfs: Fix reference counting around call to dentry_open()

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Jun 17 22:42:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch wheezy-security
in repository linux.

commit f79300d21a9bd2c41a21071d9f5cb8d9bbd23669
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Thu Jun 16 17:23:00 2016 +0100

    ecryptfs: Fix reference counting around call to dentry_open()
    
    In 3.2 dentry_open() requires its caller to bump reference counts
    on the dentry and vfsmount.
    
    Get references to dentry and mountpoint passed to dentry_open()
---
 .../all/ecryptfs-fix-handling-of-directory-opening.patch | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/debian/patches/bugfix/all/ecryptfs-fix-handling-of-directory-opening.patch b/debian/patches/bugfix/all/ecryptfs-fix-handling-of-directory-opening.patch
index 20acbec..c92a889 100644
--- a/debian/patches/bugfix/all/ecryptfs-fix-handling-of-directory-opening.patch
+++ b/debian/patches/bugfix/all/ecryptfs-fix-handling-of-directory-opening.patch
@@ -19,6 +19,7 @@ Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
 [bwh: Backported to 3.2:
  - Use ecryptfs_dentry_to_lower{,_mnt}() instead of
    ecryptfs_dentry_to_lower_path()
+ - Get references to dentry and mountpoint passed to dentry_open()
  - Use %s and explicit lookup of dentry name instead of %pd format
  - Adjust context]
 ---
@@ -50,7 +51,7 @@ Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
  	rc = read_or_initialize_metadata(ecryptfs_dentry);
  	if (rc)
  		goto out_put;
-@@ -262,6 +253,46 @@ out:
+@@ -262,6 +253,47 @@ out:
  	return rc;
  }
  
@@ -79,9 +80,10 @@ Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
 +				"Error attempting to allocate memory\n");
 +		return -ENOMEM;
 +	}
-+	lower_file = dentry_open(ecryptfs_dentry_to_lower(ecryptfs_dentry),
-+				 ecryptfs_dentry_to_lower_mnt(ecryptfs_dentry),
-+				 file->f_flags, current_cred());
++	lower_file = dentry_open(
++		dget(ecryptfs_dentry_to_lower(ecryptfs_dentry)),
++		mntget(ecryptfs_dentry_to_lower_mnt(ecryptfs_dentry)),
++		file->f_flags, current_cred());
 +	if (IS_ERR(lower_file)) {
 +		printk(KERN_ERR "%s: Error attempting to initialize "
 +			"the lower file for the dentry with name "
@@ -97,7 +99,7 @@ Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
  static int ecryptfs_flush(struct file *file, fl_owner_t td)
  {
  	struct file *lower_file = ecryptfs_file_to_lower(file);
-@@ -282,6 +313,19 @@ static int ecryptfs_release(struct inode
+@@ -282,6 +314,19 @@ static int ecryptfs_release(struct inode
  	return 0;
  }
  
@@ -117,7 +119,7 @@ Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
  static int
  ecryptfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
  {
-@@ -362,13 +406,10 @@ const struct file_operations ecryptfs_di
+@@ -362,13 +407,10 @@ const struct file_operations ecryptfs_di
  #ifdef CONFIG_COMPAT
  	.compat_ioctl = ecryptfs_compat_ioctl,
  #endif
@@ -134,7 +136,7 @@ Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
  };
  
  const struct file_operations ecryptfs_main_fops = {
-@@ -377,7 +418,6 @@ const struct file_operations ecryptfs_ma
+@@ -377,7 +419,6 @@ const struct file_operations ecryptfs_ma
  	.aio_read = ecryptfs_read_update_atime,
  	.write = do_sync_write,
  	.aio_write = generic_file_aio_write,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list