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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 15 Jan 2009 15:03:32 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	hooanon05@...oo.co.jp
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	mhalcrow@...ibm.com, ecryptfs-devel@...ts.launchpad.net
Subject: Re: [PATCH] ecryptfs: some inode attrs, and a question

On Tue, 13 Jan 2009 15:20:21 +0900
hooanon05@...oo.co.jp wrote:

> 
> Here are several fixes for linux-2.6.27/fs/ecryptfs.
> 
> - The ecryptfs inode holds a reference to the lower inode, but doesn't
>   increment the reference counter. When a user sets inotify to the
>   ecryptfs inode, it may live without the corresponding dentry. In this
>   case the referecen to the lower inode may be broken.
>   This patch maintains the reference of the lower inode.
> 
> - follow the VFS unlink sequence in ecryptfs_unlink() which is
>   inrementing and decrementing the inode->i_count and the reference
>   counter for the dentry.
> 
> - maintain the link count and ctime in ecryptfs_rmdir() because a user
>   may issue fstat(2) later.
> 
> - remove the unnecessary d_drop()s in ecryptfs_link().
> 
> And I have experienced a strange behaviour. When ecryptfs gets -ENOSPC
> from the lower fs, it converts and returns EINVAL to the userspace. Is
> this an intended behaviour?
> 

I am puzzled by the current ecryptfs maintenance situation.

I queued this for 2.6.30.  It could be bumped up for 2.6.29 (and even
backported to 2.6.28 and earlier) with suitable acks from the
maintainer(?)

> 
> ...
>
> +	atomic_inc_return(&lower_dentry->d_inode->i_count);
> +	atomic_inc_return(&lower_inode->i_count);

atomic_inc() would suffice here, yes?

From: Andrew Morton <akpm@...ux-foundation.org>

s/atomic_inc_return/atomic_inc/

Cc: Dave Kleikamp <shaggy@...ux.vnet.ibm.com>
Cc: J. R. Okajima <hooanon05@...oo.co.jp>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---

 fs/ecryptfs/inode.c |    2 +-
 fs/ecryptfs/super.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -puN fs/ecryptfs/inode.c~ecryptfs-some-inode-attr-fixes-fix fs/ecryptfs/inode.c
--- a/fs/ecryptfs/inode.c~ecryptfs-some-inode-attr-fixes-fix
+++ a/fs/ecryptfs/inode.c
@@ -479,7 +479,7 @@ static int ecryptfs_unlink(struct inode 
 
 	lower_dir_dentry = lock_parent(lower_dentry);
 	dget(lower_dentry);
-	atomic_inc_return(&lower_dentry->d_inode->i_count);
+	atomic_inc(&lower_dentry->d_inode->i_count);
 	rc = vfs_unlink(lower_dir_inode, lower_dentry);
 	dput(lower_dentry);
 	if (rc) {
diff -puN fs/ecryptfs/super.c~ecryptfs-some-inode-attr-fixes-fix fs/ecryptfs/super.c
--- a/fs/ecryptfs/super.c~ecryptfs-some-inode-attr-fixes-fix
+++ a/fs/ecryptfs/super.c
@@ -102,7 +102,7 @@ static void ecryptfs_destroy_inode(struc
  */
 void ecryptfs_init_inode(struct inode *inode, struct inode *lower_inode)
 {
-	atomic_inc_return(&lower_inode->i_count);
+	atomic_inc(&lower_inode->i_count);
 	ecryptfs_set_inode_lower(inode, lower_inode);
 	inode->i_ino = lower_inode->i_ino;
 	inode->i_version++;
_

--
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