<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/fs/ecryptfs, branch v3.2.79</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.79</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.79'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-10-13T02:46:06Z</updated>
<entry>
<title>eCryptfs: Invalidate dcache entries when lower i_nlink is zero</title>
<updated>2015-10-13T02:46:06Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2015-08-05T16:26:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=209a7a67d225f9f1550c1576326a2194c044b21f'/>
<id>urn:sha1:209a7a67d225f9f1550c1576326a2194c044b21f</id>
<content type='text'>
commit 5556e7e6d30e8e9b5ee51b0e5edd526ee80e5e36 upstream.

Consider eCryptfs dcache entries to be stale when the corresponding
lower inode's i_nlink count is zero. This solves a problem caused by the
lower inode being directly modified, without going through the eCryptfs
mount, leaving stale eCryptfs dentries cached and the eCryptfs inode's
i_nlink count not being cleared.

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reported-by: Richard Weinberger &lt;richard@nod.at&gt;
[bwh: Backported to 3.2:
 - Test d_revalidate pointer directly rather than a DCACHE_OP flag
 - Open-code d_inode()
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>eCryptfs: don't pass fs-specific ioctl commands through</title>
<updated>2015-05-09T22:16:22Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2015-02-25T01:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5ab80986f16ad450b5cddd3f76806cc323f89d1b'/>
<id>urn:sha1:5ab80986f16ad450b5cddd3f76806cc323f89d1b</id>
<content type='text'>
commit 6d65261a09adaa374c05de807f73a144d783669e upstream.

eCryptfs can't be aware of what to expect when after passing an
arbitrary ioctl command through to the lower filesystem. The ioctl
command may trigger an action in the lower filesystem that is
incompatible with eCryptfs.

One specific example is when one attempts to use the Btrfs clone
ioctl command when the source file is in the Btrfs filesystem that
eCryptfs is mounted on top of and the destination fd is from a new file
created in the eCryptfs mount. The ioctl syscall incorrectly returns
success because the command is passed down to Btrfs which thinks that it
was able to do the clone operation. However, the result is an empty
eCryptfs file.

This patch allows the trim, {g,s}etflags, and {g,s}etversion ioctl
commands through and then copies up the inode metadata from the lower
inode to the eCryptfs inode to catch any changes made to the lower
inode's metadata. Those five ioctl commands are mostly common across all
filesystems but the whitelist may need to be further pruned in the
future.

https://bugzilla.kernel.org/show_bug.cgi?id=93691
https://launchpad.net/bugs/1305335

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Cc: Rocko &lt;rockorequin@hotmail.com&gt;
Cc: Colin Ian King &lt;colin.king@canonical.com&gt;
[bwh: Backported to 3.2:
 - Adjust context
 - We don't have file_inode() so open-code the inode lookup]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>eCryptfs: Remove buggy and unnecessary write in file name decode routine</title>
<updated>2015-02-20T00:49:28Z</updated>
<author>
<name>Michael Halcrow</name>
<email>mhalcrow@google.com</email>
</author>
<published>2014-11-26T17:09:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f2d130454e46c3989af1b4f882b6a666d24fa2e0'/>
<id>urn:sha1:f2d130454e46c3989af1b4f882b6a666d24fa2e0</id>
<content type='text'>
commit 942080643bce061c3dd9d5718d3b745dcb39a8bc upstream.

Dmitry Chernenkov used KASAN to discover that eCryptfs writes past the
end of the allocated buffer during encrypted filename decoding. This
fix corrects the issue by getting rid of the unnecessary 0 write when
the current bit offset is 2.

Signed-off-by: Michael Halcrow &lt;mhalcrow@google.com&gt;
Reported-by: Dmitry Chernenkov &lt;dmitryc@google.com&gt;
Suggested-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>eCryptfs: Force RO mount when encrypted view is enabled</title>
<updated>2015-02-20T00:49:22Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2014-10-07T20:51:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e340a90b13694d8051e37cc6e2e06f6aedcd8051'/>
<id>urn:sha1:e340a90b13694d8051e37cc6e2e06f6aedcd8051</id>
<content type='text'>
commit 332b122d39c9cbff8b799007a825d94b2e7c12f2 upstream.

The ecryptfs_encrypted_view mount option greatly changes the
functionality of an eCryptfs mount. Instead of encrypting and decrypting
lower files, it provides a unified view of the encrypted files in the
lower filesystem. The presence of the ecryptfs_encrypted_view mount
option is intended to force a read-only mount and modifying files is not
supported when the feature is in use. See the following commit for more
information:

  e77a56d [PATCH] eCryptfs: Encrypted passthrough

This patch forces the mount to be read-only when the
ecryptfs_encrypted_view mount option is specified by setting the
MS_RDONLY flag on the superblock. Additionally, this patch removes some
broken logic in ecryptfs_open() that attempted to prevent modifications
of files when the encrypted view feature was in use. The check in
ecryptfs_open() was not sufficient to prevent file modifications using
system calls that do not operate on a file descriptor.

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reported-by: Priya Bansal &lt;p.bansal@samsung.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ecryptfs: avoid to access NULL pointer when write metadata in xattr</title>
<updated>2014-12-14T16:23:47Z</updated>
<author>
<name>Chao Yu</name>
<email>chao2.yu@samsung.com</email>
</author>
<published>2014-07-24T09:25:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a4f2b936759706e105436fdfd0312dfe949b5205'/>
<id>urn:sha1:a4f2b936759706e105436fdfd0312dfe949b5205</id>
<content type='text'>
commit 35425ea2492175fd39f6116481fe98b2b3ddd4ca upstream.

Christopher Head 2014-06-28 05:26:20 UTC described:
"I tried to reproduce this on 3.12.21. Instead, when I do "echo hello &gt; foo"
in an ecryptfs mount with ecryptfs_xattr specified, I get a kernel crash:

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: [&lt;ffffffff8110eb39&gt;] fsstack_copy_attr_all+0x2/0x61
PGD d7840067 PUD b2c3c067 PMD 0
Oops: 0002 [#1] SMP
Modules linked in: nvidia(PO)
CPU: 3 PID: 3566 Comm: bash Tainted: P           O 3.12.21-gentoo-r1 #2
Hardware name: ASUSTek Computer Inc. G60JX/G60JX, BIOS 206 03/15/2010
task: ffff8801948944c0 ti: ffff8800bad70000 task.ti: ffff8800bad70000
RIP: 0010:[&lt;ffffffff8110eb39&gt;]  [&lt;ffffffff8110eb39&gt;] fsstack_copy_attr_all+0x2/0x61
RSP: 0018:ffff8800bad71c10  EFLAGS: 00010246
RAX: 00000000000181a4 RBX: ffff880198648480 RCX: 0000000000000000
RDX: 0000000000000004 RSI: ffff880172010450 RDI: 0000000000000000
RBP: ffff880198490e40 R08: 0000000000000000 R09: 0000000000000000
R10: ffff880172010450 R11: ffffea0002c51e80 R12: 0000000000002000
R13: 000000000000001a R14: 0000000000000000 R15: ffff880198490e40
FS:  00007ff224caa700(0000) GS:ffff88019fcc0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000000bb07f000 CR4: 00000000000007e0
Stack:
ffffffff811826e8 ffff8800a39d8000 0000000000000000 000000000000001a
ffff8800a01d0000 ffff8800a39d8000 ffffffff81185fd5 ffffffff81082c2c
00000001a39d8000 53d0abbc98490e40 0000000000000037 ffff8800a39d8220
Call Trace:
[&lt;ffffffff811826e8&gt;] ? ecryptfs_setxattr+0x40/0x52
[&lt;ffffffff81185fd5&gt;] ? ecryptfs_write_metadata+0x1b3/0x223
[&lt;ffffffff81082c2c&gt;] ? should_resched+0x5/0x23
[&lt;ffffffff8118322b&gt;] ? ecryptfs_initialize_file+0xaf/0xd4
[&lt;ffffffff81183344&gt;] ? ecryptfs_create+0xf4/0x142
[&lt;ffffffff810f8c0d&gt;] ? vfs_create+0x48/0x71
[&lt;ffffffff810f9c86&gt;] ? do_last.isra.68+0x559/0x952
[&lt;ffffffff810f7ce7&gt;] ? link_path_walk+0xbd/0x458
[&lt;ffffffff810fa2a3&gt;] ? path_openat+0x224/0x472
[&lt;ffffffff810fa7bd&gt;] ? do_filp_open+0x2b/0x6f
[&lt;ffffffff81103606&gt;] ? __alloc_fd+0xd6/0xe7
[&lt;ffffffff810ee6ab&gt;] ? do_sys_open+0x65/0xe9
[&lt;ffffffff8157d022&gt;] ? system_call_fastpath+0x16/0x1b
RIP  [&lt;ffffffff8110eb39&gt;] fsstack_copy_attr_all+0x2/0x61
RSP &lt;ffff8800bad71c10&gt;
CR2: 0000000000000000
---[ end trace df9dba5f1ddb8565 ]---"

If we create a file when we mount with ecryptfs_xattr_metadata option, we will
encounter a crash in this path:
-&gt;ecryptfs_create
  -&gt;ecryptfs_initialize_file
    -&gt;ecryptfs_write_metadata
      -&gt;ecryptfs_write_metadata_to_xattr
        -&gt;ecryptfs_setxattr
          -&gt;fsstack_copy_attr_all
It's because our dentry-&gt;d_inode used in fsstack_copy_attr_all is NULL, and it
will be initialized when ecryptfs_initialize_file finish.

So we should skip copying attr from lower inode when the value of -&gt;d_inode is
invalid.

Signed-off-by: Chao Yu &lt;chao2.yu@samsung.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ecryptfs: Fix memory leakage in keystore.c</title>
<updated>2013-11-28T14:02:04Z</updated>
<author>
<name>Geyslan G. Bem</name>
<email>geyslan@gmail.com</email>
</author>
<published>2013-10-11T19:49:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=640c4ad6d759b60a64049ff46c9acff5954f18d6'/>
<id>urn:sha1:640c4ad6d759b60a64049ff46c9acff5954f18d6</id>
<content type='text'>
commit 3edc8376c06133e3386265a824869cad03a4efd4 upstream.

In 'decrypt_pki_encrypted_session_key' function:

Initializes 'payload' pointer and releases it on exit.

Signed-off-by: Geyslan G. Bem &lt;geyslan@gmail.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>eCryptfs: check for eCryptfs cipher support at mount</title>
<updated>2012-11-16T16:47:19Z</updated>
<author>
<name>Tim Sally</name>
<email>tsally@atomicpeace.com</email>
</author>
<published>2012-07-12T23:10:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=50a2114dde86ea598918716f1b44fdc88f3692d8'/>
<id>urn:sha1:50a2114dde86ea598918716f1b44fdc88f3692d8</id>
<content type='text'>
commit 5f5b331d5c21228a6519dcb793fc1629646c51a6 upstream.

The issue occurs when eCryptfs is mounted with a cipher supported by
the crypto subsystem but not by eCryptfs. The mount succeeds and an
error does not occur until a write. This change checks for eCryptfs
cipher support at mount time.

Resolves Launchpad issue #338914, reported by Tyler Hicks in 03/2009.
https://bugs.launchpad.net/ecryptfs/+bug/338914

Signed-off-by: Tim Sally &lt;tsally@atomicpeace.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>eCryptfs: Copy up POSIX ACL and read-only flags from lower mount</title>
<updated>2012-11-16T16:47:18Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2012-06-11T22:42:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=916fef09cb43ee4aad40129b3f9e3fd4bb1c641f'/>
<id>urn:sha1:916fef09cb43ee4aad40129b3f9e3fd4bb1c641f</id>
<content type='text'>
commit 069ddcda37b2cf5bb4b6031a944c0e9359213262 upstream.

When the eCryptfs mount options do not include '-o acl', but the lower
filesystem's mount options do include 'acl', the MS_POSIXACL flag is not
flipped on in the eCryptfs super block flags. This flag is what the VFS
checks in do_last() when deciding if the current umask should be applied
to a newly created inode's mode or not. When a default POSIX ACL mask is
set on a directory, the current umask is incorrectly applied to new
inodes created in the directory. This patch ignores the MS_POSIXACL flag
passed into ecryptfs_mount() and sets the flag on the eCryptfs super
block depending on the flag's presence on the lower super block.

Additionally, it is incorrect to allow a writeable eCryptfs mount on top
of a read-only lower mount. This missing check did not allow writes to
the read-only lower mount because permissions checks are still performed
on the lower filesystem's objects but it is best to simply not allow a
rw mount on top of ro mount. However, a ro eCryptfs mount on top of a rw
mount is valid and still allowed.

https://launchpad.net/bugs/1009207

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reported-by: Stefan Beller &lt;stefanbeller@googlemail.com&gt;
Cc: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>eCryptfs: Call lower -&gt;flush() from ecryptfs_flush()</title>
<updated>2012-10-17T02:49:54Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2012-09-13T01:38:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4dcbf47bac95e0b7cb4e6fa5347318117a19b580'/>
<id>urn:sha1:4dcbf47bac95e0b7cb4e6fa5347318117a19b580</id>
<content type='text'>
commit 64e6651dcc10e9d2cc6230208a8e6c2cfd19ae18 upstream.

Since eCryptfs only calls fput() on the lower file in
ecryptfs_release(), eCryptfs should call the lower filesystem's
-&gt;flush() from ecryptfs_flush().

If the lower filesystem implements -&gt;flush(), then eCryptfs should try
to flush out any dirty pages prior to calling the lower -&gt;flush(). If
the lower filesystem does not implement -&gt;flush(), then eCryptfs has no
need to do anything in ecryptfs_flush() since dirty pages are now
written out to the lower filesystem in ecryptfs_release().

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>eCryptfs: Write out all dirty pages just before releasing the lower file</title>
<updated>2012-10-17T02:49:53Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2012-09-13T01:02:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2f45faef3bca26259cb419692f70788e5b77f563'/>
<id>urn:sha1:2f45faef3bca26259cb419692f70788e5b77f563</id>
<content type='text'>
commit 7149f2558d5b5b988726662fe58b1c388337805b upstream.

Fixes a regression caused by:

821f749 eCryptfs: Revert to a writethrough cache model

That patch reverted some code (specifically, 32001d6f) that was
necessary to properly handle open() -&gt; mmap() -&gt; close() -&gt; dirty pages
-&gt; munmap(), because the lower file could be closed before the dirty
pages are written out.

Rather than reapplying 32001d6f, this approach is a better way of
ensuring that the lower file is still open in order to handle writing
out the dirty pages. It is called from ecryptfs_release(), while we have
a lock on the lower file pointer, just before the lower file gets the
final fput() and we overwrite the pointer.

https://launchpad.net/bugs/1047261

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reported-by: Artemy Tregubenko &lt;me@arty.name&gt;
Tested-by: Artemy Tregubenko &lt;me@arty.name&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>
</feed>
