lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20071219181417.GP13486@halcrow.us>
Date:	Wed, 19 Dec 2007 12:14:17 -0600
From:	Michael Halcrow <mike@...crow.us>
To:	Eric Sandeen <sandeen@...hat.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...l.org>,
	Michael Halcrow <mhalcrow@...ibm.com>,
	Jeff Moyer <jmoyer@...hat.com>
Subject: Re: [PATCH] ecryptfs: redo dget,mntget on dentry_open failure

On Wed, Dec 19, 2007 at 11:34:25AM -0600, Eric Sandeen wrote:
> Thanks to Jeff Moyer for pointing this out.
> 
> If the RDWR dentry_open() in ecryptfs_init_persistent_file fails,
> it will do a dput/mntput.  Need to re-take references if we
> retry as RDONLY.
> 
> Signed-off-by: Eric Sandeen <sandeen@...hat.com>

Acked-by: Mike Halcrow <mhalcrow@...ibm.com>

> ---
> 
> Index: linux-2.6.24-rc3/fs/ecryptfs/main.c
> ===================================================================
> --- linux-2.6.24-rc3.orig/fs/ecryptfs/main.c
> +++ linux-2.6.24-rc3/fs/ecryptfs/main.c
> @@ -138,11 +138,14 @@ int ecryptfs_init_persistent_file(struct
>  		inode_info->lower_file = dentry_open(lower_dentry,
>  						     lower_mnt,
>  						     (O_RDWR | O_LARGEFILE));
> -		if (IS_ERR(inode_info->lower_file))
> +		if (IS_ERR(inode_info->lower_file)) {
> +			dget(lower_dentry);
> +			mntget(lower_mnt);
>  			inode_info->lower_file = dentry_open(lower_dentry,
>  							     lower_mnt,
>  							     (O_RDONLY
>  							      | O_LARGEFILE));
> +		}
>  		if (IS_ERR(inode_info->lower_file)) {
>  			printk(KERN_ERR "Error opening lower persistent file "
>  			       "for lower_dentry [0x%p] and lower_mnt [0x%p]\n",
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ