<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ecryptfs/inode.c, branch v3.2.31</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/ecryptfs/inode.c?h=v3.2.31</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/ecryptfs/inode.c?h=v3.2.31'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-09-19T14:05:24Z</updated>
<entry>
<title>eCryptfs: Copy up attributes of the lower target inode after rename</title>
<updated>2012-09-19T14:05:24Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2012-09-13T19:00:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=62ae7bbdbb77a210eb839f34dc0d1923a4842dbd'/>
<id>urn:sha1:62ae7bbdbb77a210eb839f34dc0d1923a4842dbd</id>
<content type='text'>
commit 8335eafc2859e1a26282bef7c3d19f3d68868b8a upstream.

After calling into the lower filesystem to do a rename, the lower target
inode's attributes were not copied up to the eCryptfs target inode. This
resulted in the eCryptfs target inode staying around, rather than being
evicted, because i_nlink was not updated for the eCryptfs inode. This
also meant that eCryptfs didn't do the final iput() on the lower target
inode so it stayed around, as well. This would result in a failure to
free up space occupied by the target file in the rename() operation.
Both target inodes would eventually be evicted when the eCryptfs
filesystem was unmounted.

This patch calls fsstack_copy_attr_all() after the lower filesystem
does its -&gt;rename() so that important inode attributes, such as i_nlink,
are updated at the eCryptfs layer. ecryptfs_evict_inode() is now called
and eCryptfs can drop its final reference on the lower inode.

http://launchpad.net/bugs/561129

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Tested-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>eCryptfs: Copy up lower inode attrs after setting lower xattr</title>
<updated>2012-03-01T00:30:52Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2012-02-07T23:55:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6b6cd603f9bde174d9cf18060264204587d4a9fb'/>
<id>urn:sha1:6b6cd603f9bde174d9cf18060264204587d4a9fb</id>
<content type='text'>
commit 545d680938be1e86a6c5250701ce9abaf360c495 upstream.

After passing through a -&gt;setxattr() call, eCryptfs needs to copy the
inode attributes from the lower inode to the eCryptfs inode, as they
may have changed in the lower filesystem's -&gt;setxattr() path.

One example is if an extended attribute containing a POSIX Access
Control List is being set. The new ACL may cause the lower filesystem to
modify the mode of the lower inode and the eCryptfs inode would need to
be updated to reflect the new mode.

https://launchpad.net/bugs/926292

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reported-by: Sebastien Bacher &lt;seb128@ubuntu.com&gt;
Cc: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>eCryptfs: Check inode changes in setattr</title>
<updated>2012-02-03T17:21:24Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2012-01-20T02:33:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=963f50802b55b7df757ec9c44ccab130524c4d54'/>
<id>urn:sha1:963f50802b55b7df757ec9c44ccab130524c4d54</id>
<content type='text'>
commit a261a03904849c3df50bd0300efb7fb3f865137d upstream.

Most filesystems call inode_change_ok() very early in -&gt;setattr(), but
eCryptfs didn't call it at all. It allowed the lower filesystem to make
the call in its -&gt;setattr() function. Then, eCryptfs would copy the
appropriate inode attributes from the lower inode to the eCryptfs inode.

This patch changes that and actually calls inode_change_ok() on the
eCryptfs inode, fairly early in ecryptfs_setattr(). Ideally, the call
would happen earlier in ecryptfs_setattr(), but there are some possible
inode initialization steps that must happen first.

Since the call was already being made on the lower inode, the change in
functionality should be minimal, except for the case of a file extending
truncate call. In that case, inode_newsize_ok() was never being
called on the eCryptfs inode. Rather than inode_newsize_ok() catching
maximum file size errors early on, eCryptfs would encrypt zeroed pages
and write them to the lower filesystem until the lower filesystem's
write path caught the error in generic_write_checks(). This patch
introduces a new function, called ecryptfs_inode_newsize_ok(), which
checks if the new lower file size is within the appropriate limits when
the truncate operation will be growing the lower file.

In summary this change prevents eCryptfs truncate operations (and the
resulting page encryptions), which would exceed the lower filesystem
limits or FSIZE rlimits, from ever starting.

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reviewed-by: Li Wang &lt;liwang@nudt.edu.cn&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>eCryptfs: Prevent file create race condition</title>
<updated>2011-11-23T21:39:38Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2011-11-21T23:31:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b59db43ad4434519feb338eacb01d77eb50825c5'/>
<id>urn:sha1:b59db43ad4434519feb338eacb01d77eb50825c5</id>
<content type='text'>
The file creation path prematurely called d_instantiate() and
unlock_new_inode() before the eCryptfs inode info was fully
allocated and initialized and before the eCryptfs metadata was written
to the lower file.

This could result in race conditions in subsequent file and inode
operations leading to unexpected error conditions or a null pointer
dereference while attempting to use the unallocated memory.

https://launchpad.net/bugs/813146

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>filesystems: add set_nlink()</title>
<updated>2011-11-02T11:53:43Z</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2011-10-28T12:13:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bfe8684869601dacfcb2cd69ef8cfd9045f62170'/>
<id>urn:sha1:bfe8684869601dacfcb2cd69ef8cfd9045f62170</id>
<content type='text'>
Replace remaining direct i_nlink updates with a new set_nlink()
updater function.

Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Tested-by: Toshiyuki Okajima &lt;toshi.okajima@jp.fujitsu.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>ecryptfs: Make inode bdi consistent with superblock bdi</title>
<updated>2011-07-29T04:48:26Z</updated>
<author>
<name>Thieu Le</name>
<email>thieule@chromium.org</email>
</author>
<published>2011-07-26T23:15:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=985ca0e626e195ea08a1a82b8dbeb6719747429a'/>
<id>urn:sha1:985ca0e626e195ea08a1a82b8dbeb6719747429a</id>
<content type='text'>
Make the inode mapping bdi consistent with the superblock bdi so that
dirty pages are flushed properly.

Signed-off-by: Thieu Le &lt;thieule@chromium.org&gt;
Cc: &lt;stable@kernel.org&gt; [2.6.39+]
Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>don't pass nameidata to vfs_create() from ecryptfs_create()</title>
<updated>2011-07-20T05:43:54Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-06-26T01:08:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bf6c7f6c7bd0ea779757d35b5fdc9f9157f056b3'/>
<id>urn:sha1:bf6c7f6c7bd0ea779757d35b5fdc9f9157f056b3</id>
<content type='text'>
Instead of playing with removal of LOOKUP_OPEN, mangling (and
restoring) nd-&gt;path, just pass NULL to vfs_create().  The whole
point of what's being done there is to suppress any attempts
to open file by underlying fs, which is what nd == NULL indicates.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ecryptfs_inode_permission() doesn't need to bail out on RCU</title>
<updated>2011-07-20T05:43:38Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-06-21T05:01:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=beefebf1aa611242e022e71bae87034f415d3314'/>
<id>urn:sha1:beefebf1aa611242e022e71bae87034f415d3314</id>
<content type='text'>
... now that inode_permission() can take MAY_NOT_BLOCK and handle it
properly.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>-&gt;permission() sanitizing: don't pass flags to -&gt;permission()</title>
<updated>2011-07-20T05:43:24Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-06-20T23:28:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=10556cb21a0d0b24d95f00ea6df16f599a3345b2'/>
<id>urn:sha1:10556cb21a0d0b24d95f00ea6df16f599a3345b2</id>
<content type='text'>
not used by the instances anymore.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>eCryptfs: Cleanup and optimize ecryptfs_lookup_interpose()</title>
<updated>2011-05-29T19:24:24Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@linux.vnet.ibm.com</email>
</author>
<published>2011-05-24T09:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=778aeb42a708d2a57e491d2cbb5a1e74f61270b9'/>
<id>urn:sha1:778aeb42a708d2a57e491d2cbb5a1e74f61270b9</id>
<content type='text'>
ecryptfs_lookup_interpose() has turned into spaghetti code over the
years. This is an effort to clean it up.

 - Shorten overly descriptive variable names such as ecryptfs_dentry
 - Simplify gotos and error paths
 - Create helper function for reading plaintext i_size from metadata

It also includes an optimization when reading i_size from the metadata.
A complete page-sized kmem_cache_alloc() was being done to read in 16
bytes of metadata. The buffer for that is now statically declared.

Signed-off-by: Tyler Hicks &lt;tyhicks@linux.vnet.ibm.com&gt;
</content>
</entry>
</feed>
