<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/ecryptfs, branch v2.6.33.5</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>ecryptfs: fix error code for missing xattrs in lower fs</title>
<updated>2010-04-26T14:48:01+00:00</updated>
<author>
<name>Christian Pulvermacher</name>
<email>pulvermacher@gmx.de</email>
</author>
<published>2010-03-23T16:51:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ffa1b5d9e6bf7d944f3bfa119a66af639fca98c4'/>
<id>ffa1b5d9e6bf7d944f3bfa119a66af639fca98c4</id>
<content type='text'>
commit cfce08c6bdfb20ade979284e55001ca1f100ed51 upstream.

If the lower file system driver has extended attributes disabled,
ecryptfs' own access functions return -ENOSYS instead of -EOPNOTSUPP.
This breaks execution of programs in the ecryptfs mount, since the
kernel expects the latter error when checking for security
capabilities in xattrs.

Signed-off-by: Christian Pulvermacher &lt;pulvermacher@gmx.de&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit cfce08c6bdfb20ade979284e55001ca1f100ed51 upstream.

If the lower file system driver has extended attributes disabled,
ecryptfs' own access functions return -ENOSYS instead of -EOPNOTSUPP.
This breaks execution of programs in the ecryptfs mount, since the
kernel expects the latter error when checking for security
capabilities in xattrs.

Signed-off-by: Christian Pulvermacher &lt;pulvermacher@gmx.de&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: Decrypt symlink target for stat size</title>
<updated>2010-04-26T14:48:01+00:00</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@linux.vnet.ibm.com</email>
</author>
<published>2010-03-22T05:41:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8371038fa54c8051c6624560f3777e629b9eef68'/>
<id>8371038fa54c8051c6624560f3777e629b9eef68</id>
<content type='text'>
commit 3a60a1686f0d51c99bd0df8ac93050fb6dfce647 upstream.

Create a getattr handler for eCryptfs symlinks that is capable of
reading the lower target and decrypting its path.  Prior to this patch,
a stat's st_size field would represent the strlen of the encrypted path,
while readlink() would return the strlen of the decrypted path.  This
could lead to confusion in some userspace applications, since the two
values should be equal.

https://bugs.launchpad.net/bugs/524919

Reported-by: Loïc Minier &lt;loic.minier@canonical.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3a60a1686f0d51c99bd0df8ac93050fb6dfce647 upstream.

Create a getattr handler for eCryptfs symlinks that is capable of
reading the lower target and decrypting its path.  Prior to this patch,
a stat's st_size field would represent the strlen of the encrypted path,
while readlink() would return the strlen of the decrypted path.  This
could lead to confusion in some userspace applications, since the two
values should be equal.

https://bugs.launchpad.net/bugs/524919

Reported-by: Loïc Minier &lt;loic.minier@canonical.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: fix use with tmpfs by removing d_drop from ecryptfs_destroy_inode</title>
<updated>2010-04-26T14:48:01+00:00</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@jeffreymahoney.com</email>
</author>
<published>2010-03-19T19:35:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0766ff5226c060424f7d5d6f9e5904b22879b389'/>
<id>0766ff5226c060424f7d5d6f9e5904b22879b389</id>
<content type='text'>
commit 133b8f9d632cc23715c6d72d1c5ac449e054a12a upstream.

Since tmpfs has no persistent storage, it pins all its dentries in memory
so they have d_count=1 when other file systems would have d_count=0.
-&gt;lookup is only used to create new dentries. If the caller doesn't
instantiate it, it's freed immediately at dput(). -&gt;readdir reads
directly from the dcache and depends on the dentries being hashed.

When an ecryptfs mount is mounted, it associates the lower file and dentry
with the ecryptfs files as they're accessed. When it's umounted and
destroys all the in-memory ecryptfs inodes, it fput's the lower_files and
d_drop's the lower_dentries. Commit 4981e081 added this and a d_delete in
2008 and several months later commit caeeeecf removed the d_delete. I
believe the d_drop() needs to be removed as well.

The d_drop effectively hides any file that has been accessed via ecryptfs
from the underlying tmpfs since it depends on it being hashed for it to
be accessible. I've removed the d_drop on my development node and see no
ill effects with basic testing on both tmpfs and persistent storage.

As a side effect, after ecryptfs d_drops the dentries on tmpfs, tmpfs
BUGs on umount. This is due to the dentries being unhashed.
tmpfs-&gt;kill_sb is kill_litter_super which calls d_genocide to drop
the reference pinning the dentry. It skips unhashed and negative dentries,
but shrink_dcache_for_umount_subtree doesn't. Since those dentries
still have an elevated d_count, we get a BUG().

This patch removes the d_drop call and fixes both issues.

This issue was reported at:
https://bugzilla.novell.com/show_bug.cgi?id=567887

Reported-by:  Árpád Bíró &lt;biroa@demasz.hu&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Cc: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 133b8f9d632cc23715c6d72d1c5ac449e054a12a upstream.

Since tmpfs has no persistent storage, it pins all its dentries in memory
so they have d_count=1 when other file systems would have d_count=0.
-&gt;lookup is only used to create new dentries. If the caller doesn't
instantiate it, it's freed immediately at dput(). -&gt;readdir reads
directly from the dcache and depends on the dentries being hashed.

When an ecryptfs mount is mounted, it associates the lower file and dentry
with the ecryptfs files as they're accessed. When it's umounted and
destroys all the in-memory ecryptfs inodes, it fput's the lower_files and
d_drop's the lower_dentries. Commit 4981e081 added this and a d_delete in
2008 and several months later commit caeeeecf removed the d_delete. I
believe the d_drop() needs to be removed as well.

The d_drop effectively hides any file that has been accessed via ecryptfs
from the underlying tmpfs since it depends on it being hashed for it to
be accessible. I've removed the d_drop on my development node and see no
ill effects with basic testing on both tmpfs and persistent storage.

As a side effect, after ecryptfs d_drops the dentries on tmpfs, tmpfs
BUGs on umount. This is due to the dentries being unhashed.
tmpfs-&gt;kill_sb is kill_litter_super which calls d_genocide to drop
the reference pinning the dentry. It skips unhashed and negative dentries,
but shrink_dcache_for_umount_subtree doesn't. Since those dentries
still have an elevated d_count, we get a BUG().

This patch removes the d_drop call and fixes both issues.

This issue was reported at:
https://bugzilla.novell.com/show_bug.cgi?id=567887

Reported-by:  Árpád Bíró &lt;biroa@demasz.hu&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Cc: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: use after free</title>
<updated>2010-01-20T04:36:06+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2010-01-19T09:34:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ece550f51ba175c14ec3ec047815927d7386ea1f'/>
<id>ece550f51ba175c14ec3ec047815927d7386ea1f</id>
<content type='text'>
The "full_alg_name" variable is used on a couple error paths, so we
shouldn't free it until the end.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Cc: stable@kernel.org
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The "full_alg_name" variable is used on a couple error paths, so we
shouldn't free it until the end.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Cc: stable@kernel.org
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: Eliminate useless code</title>
<updated>2010-01-20T04:36:05+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>julia@diku.dk</email>
</author>
<published>2010-01-16T16:00:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4aa25bcb7dac2d583f1557e2be2d0b598581da54'/>
<id>4aa25bcb7dac2d583f1557e2be2d0b598581da54</id>
<content type='text'>
The variable lower_dentry is initialized twice to the same (side effect-free)
expression.  Drop one initialization.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@forall@
idexpression *x;
identifier f!=ERR_PTR;
@@

x = f(...)
... when != x
(
x = f(...,&lt;+...x...+&gt;,...)
|
* x = f(...)
)
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The variable lower_dentry is initialized twice to the same (side effect-free)
expression.  Drop one initialization.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@forall@
idexpression *x;
identifier f!=ERR_PTR;
@@

x = f(...)
... when != x
(
x = f(...,&lt;+...x...+&gt;,...)
|
* x = f(...)
)
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;julia@diku.dk&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: fix interpose/interpolate typos in comments</title>
<updated>2010-01-20T04:36:03+00:00</updated>
<author>
<name>Erez Zadok</name>
<email>ezk@cs.sunysb.edu</email>
</author>
<published>2010-01-04T23:17:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fe0fc013cd8bbd2f4737c1b2694b37dd7fe459cb'/>
<id>fe0fc013cd8bbd2f4737c1b2694b37dd7fe459cb</id>
<content type='text'>
Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Acked-by: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Acked-by: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: pass matching flags to interpose as defined and used there</title>
<updated>2010-01-20T04:36:02+00:00</updated>
<author>
<name>Erez Zadok</name>
<email>ezk@cs.sunysb.edu</email>
</author>
<published>2009-12-06T23:51:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3469b57329f80db5a41cf42d1c8f7690269f57e7'/>
<id>3469b57329f80db5a41cf42d1c8f7690269f57e7</id>
<content type='text'>
ecryptfs_interpose checks if one of the flags passed is
ECRYPTFS_INTERPOSE_FLAG_D_ADD, defined as 0x00000001 in ecryptfs_kernel.h.
But the only user of ecryptfs_interpose to pass a non-zero flag to it, has
hard-coded the value as "1". This could spell trouble if any of these values
changes in the future.

Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Cc: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ecryptfs_interpose checks if one of the flags passed is
ECRYPTFS_INTERPOSE_FLAG_D_ADD, defined as 0x00000001 in ecryptfs_kernel.h.
But the only user of ecryptfs_interpose to pass a non-zero flag to it, has
hard-coded the value as "1". This could spell trouble if any of these values
changes in the future.

Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Cc: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: remove unnecessary d_drop calls in ecryptfs_link</title>
<updated>2010-01-20T04:36:00+00:00</updated>
<author>
<name>Erez Zadok</name>
<email>ezk@cs.sunysb.edu</email>
</author>
<published>2009-12-06T23:05:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c44a66d674688f1e1d0b2f6f56bd9c6a1b061cae'/>
<id>c44a66d674688f1e1d0b2f6f56bd9c6a1b061cae</id>
<content type='text'>
Unnecessary because it would unhash perfectly valid dentries, causing them
to have to be re-looked up the next time they're needed, which presumably is
right after.

Signed-off-by: Aseem Rastogi &lt;arastogi@cs.sunysb.edu&gt;
Signed-off-by: Shrikar archak &lt;shrikar84@gmail.com&gt;
Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Cc: Saumitra Bhanage &lt;sbhanage@cs.sunysb.edu&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unnecessary because it would unhash perfectly valid dentries, causing them
to have to be re-looked up the next time they're needed, which presumably is
right after.

Signed-off-by: Aseem Rastogi &lt;arastogi@cs.sunysb.edu&gt;
Signed-off-by: Shrikar archak &lt;shrikar84@gmail.com&gt;
Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Cc: Saumitra Bhanage &lt;sbhanage@cs.sunysb.edu&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: don't ignore return value from lock_rename</title>
<updated>2010-01-20T04:35:59+00:00</updated>
<author>
<name>Erez Zadok</name>
<email>ezk@cs.sunysb.edu</email>
</author>
<published>2009-12-06T02:17:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0d132f7364694da8f7cafd49e2fc2721b73e96e4'/>
<id>0d132f7364694da8f7cafd49e2fc2721b73e96e4</id>
<content type='text'>
Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Cc: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Cc: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: initialize private persistent file before dereferencing pointer</title>
<updated>2010-01-20T04:32:54+00:00</updated>
<author>
<name>Erez Zadok</name>
<email>ezk@cs.sunysb.edu</email>
</author>
<published>2009-12-03T18:35:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e27759d7a333d1f25d628c4f7caf845c51be51c2'/>
<id>e27759d7a333d1f25d628c4f7caf845c51be51c2</id>
<content type='text'>
Ecryptfs_open dereferences a pointer to the private lower file (the one
stored in the ecryptfs inode), without checking if the pointer is NULL.
Right afterward, it initializes that pointer if it is NULL.  Swap order of
statements to first initialize.  Bug discovered by Duckjin Kang.

Signed-off-by: Duckjin Kang &lt;fromdj2k@gmail.com&gt;
Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Cc: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ecryptfs_open dereferences a pointer to the private lower file (the one
stored in the ecryptfs inode), without checking if the pointer is NULL.
Right afterward, it initializes that pointer if it is NULL.  Swap order of
statements to first initialize.  Bug discovered by Duckjin Kang.

Signed-off-by: Duckjin Kang &lt;fromdj2k@gmail.com&gt;
Signed-off-by: Erez Zadok &lt;ezk@cs.sunysb.edu&gt;
Cc: Dustin Kirkland &lt;kirkland@canonical.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
