<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/fs/ecryptfs/crypto.c, branch v2.6.25</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>ecryptfs: check for existing key_tfm at mount time</title>
<updated>2008-02-06T18:41:13+00:00</updated>
<author>
<name>Eric Sandeen</name>
<email>sandeen@redhat.com</email>
</author>
<published>2008-02-06T09:38:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=af440f52927e4b6941aa94e3cfc698adb0f22663'/>
<id>af440f52927e4b6941aa94e3cfc698adb0f22663</id>
<content type='text'>
Jeff Moyer pointed out that a mount; umount loop of ecryptfs, with the same
cipher &amp; other mount options, created a new ecryptfs_key_tfm_cache item
each time, and the cache could grow quite large this way.

Looking at this with mhalcrow, we saw that ecryptfs_parse_options()
unconditionally called ecryptfs_add_new_key_tfm(), which is what was adding
these items.

Refactor ecryptfs_get_tfm_and_mutex_for_cipher_name() to create a new
helper function, ecryptfs_tfm_exists(), which checks for the cipher on the
cached key_tfm_list, and sets a pointer to it if it exists.  This can then
be called from ecryptfs_parse_options(), and new key_tfm's can be added
only when a cached one is not found.

With list locking changes suggested by akpm.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Cc: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Jeff Moyer pointed out that a mount; umount loop of ecryptfs, with the same
cipher &amp; other mount options, created a new ecryptfs_key_tfm_cache item
each time, and the cache could grow quite large this way.

Looking at this with mhalcrow, we saw that ecryptfs_parse_options()
unconditionally called ecryptfs_add_new_key_tfm(), which is what was adding
these items.

Refactor ecryptfs_get_tfm_and_mutex_for_cipher_name() to create a new
helper function, ecryptfs_tfm_exists(), which checks for the cipher on the
cached key_tfm_list, and sets a pointer to it if it exists.  This can then
be called from ecryptfs_parse_options(), and new key_tfm's can be added
only when a cached one is not found.

With list locking changes suggested by akpm.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Cc: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: change the type of cipher_code from u16 to u8</title>
<updated>2008-02-06T18:41:13+00:00</updated>
<author>
<name>Trevor Highland</name>
<email>thighlan@gmail.com</email>
</author>
<published>2008-02-06T09:38:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=19e66a67e9b25874cd5e184e7d381ce1b955df11'/>
<id>19e66a67e9b25874cd5e184e7d381ce1b955df11</id>
<content type='text'>
Only the lower byte of cipher_code is ever used, so it makes sense
for its type to be u8.

Signed-off-by: Trevor Highland &lt;trevor.highland@gmail.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only the lower byte of cipher_code is ever used, so it makes sense
for its type to be u8.

Signed-off-by: Trevor Highland &lt;trevor.highland@gmail.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: Minor fixes to printk messages</title>
<updated>2008-02-06T18:41:12+00:00</updated>
<author>
<name>Michael Halcrow</name>
<email>mike@halcrow.us</email>
</author>
<published>2008-02-06T09:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=25bd8174036036f427b039e4857feac6c6912a37'/>
<id>25bd8174036036f427b039e4857feac6c6912a37</id>
<content type='text'>
The printk statements that result when the user does not have the
proper key available could use some refining.

Signed-off-by: Mike Halcrow &lt;mhalcrow@us.ibm.com&gt;
Cc: Mike Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The printk statements that result when the user does not have the
proper key available could use some refining.

Signed-off-by: Mike Halcrow &lt;mhalcrow@us.ibm.com&gt;
Cc: Mike Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: set inode key only once per crypto operation</title>
<updated>2008-02-06T18:41:12+00:00</updated>
<author>
<name>Trevor Highland</name>
<email>trevor.highland@gmail.com</email>
</author>
<published>2008-02-06T09:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8e3a6f16ba5874b69968cd450334829262513fd1'/>
<id>8e3a6f16ba5874b69968cd450334829262513fd1</id>
<content type='text'>
There is no need to keep re-setting the same key for any given eCryptfs inode.
This patch optimizes the use of the crypto API and helps performance a bit.

Signed-off-by: Trevor Highland &lt;trevor.highland@gmail.com&gt;
Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no need to keep re-setting the same key for any given eCryptfs inode.
This patch optimizes the use of the crypto API and helps performance a bit.

Signed-off-by: Trevor Highland &lt;trevor.highland@gmail.com&gt;
Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: track header bytes rather than extents</title>
<updated>2008-02-06T18:41:12+00:00</updated>
<author>
<name>Michael Halcrow</name>
<email>mhalcrow@us.ibm.com</email>
</author>
<published>2008-02-06T09:38:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cc11beffdf80ca31dff21422fa2a5e54d25f1494'/>
<id>cc11beffdf80ca31dff21422fa2a5e54d25f1494</id>
<content type='text'>
Remove internal references to header extents; just keep track of header bytes
instead.  Headers can easily span multiple pages with the recent persistent
file changes.

Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove internal references to header extents; just keep track of header bytes
instead.  Headers can easily span multiple pages with the recent persistent
file changes.

Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs/ecryptfs/: possible cleanups</title>
<updated>2008-02-06T18:41:12+00:00</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@kernel.org</email>
</author>
<published>2008-02-06T09:38:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7896b631823c6e8f1a520d89390624a51445840e'/>
<id>7896b631823c6e8f1a520d89390624a51445840e</id>
<content type='text'>
- make the following needlessly global code static:
  - crypto.c:ecryptfs_lower_offset_for_extent()
  - crypto.c:key_tfm_list
  - crypto.c:key_tfm_list_mutex
  - inode.c:ecryptfs_getxattr()
  - main.c:ecryptfs_init_persistent_file()

- remove the no longer used mmap.c:ecryptfs_lower_page_cache

- #if 0 the unused read_write.c:ecryptfs_read()

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- make the following needlessly global code static:
  - crypto.c:ecryptfs_lower_offset_for_extent()
  - crypto.c:key_tfm_list
  - crypto.c:key_tfm_list_mutex
  - inode.c:ecryptfs_getxattr()
  - main.c:ecryptfs_init_persistent_file()

- remove the no longer used mmap.c:ecryptfs_lower_page_cache

- #if 0 the unused read_write.c:ecryptfs_read()

Signed-off-by: Adrian Bunk &lt;bunk@kernel.org&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: fix unlocking in error paths</title>
<updated>2007-12-23T20:54:37+00:00</updated>
<author>
<name>Eric Sandeen</name>
<email>sandeen@redhat.com</email>
</author>
<published>2007-12-22T22:03:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c8161f64ccdcc3ac05c7bbfebc031e7ad5ca6412'/>
<id>c8161f64ccdcc3ac05c7bbfebc031e7ad5ca6412</id>
<content type='text'>
Thanks to Josef Bacik for finding these.

A couple of ecryptfs error paths don't properly unlock things they locked.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Cc: Josef Bacik &lt;jbacik@redhat.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Thanks to Josef Bacik for finding these.

A couple of ecryptfs error paths don't properly unlock things they locked.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Cc: Josef Bacik &lt;jbacik@redhat.com&gt;
Cc: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ecryptfs: fix string overflow on long cipher names</title>
<updated>2007-12-23T20:54:36+00:00</updated>
<author>
<name>Eric Sandeen</name>
<email>sandeen@redhat.com</email>
</author>
<published>2007-12-22T22:03:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b88629060b03adc58639f818fe0968bf5fe81b5d'/>
<id>b88629060b03adc58639f818fe0968bf5fe81b5d</id>
<content type='text'>
Passing a cipher name &gt; 32 chars on mount results in an overflow when the
cipher name is printed, because the last character in the struct
ecryptfs_key_tfm's cipher_name string was never zeroed.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Acked-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Passing a cipher name &gt; 32 chars on mount results in an overflow when the
cipher name is printed, because the last character in the struct
ecryptfs_key_tfm's cipher_name string was never zeroed.

Signed-off-by: Eric Sandeen &lt;sandeen@redhat.com&gt;
Acked-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: release mutex on hash error path</title>
<updated>2007-11-05T23:12:33+00:00</updated>
<author>
<name>Michael Halcrow</name>
<email>mhalcrow@us.ibm.com</email>
</author>
<published>2007-11-05T22:51:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8a29f2b0288ba2a8fb302f9a639521ac9ff302e5'/>
<id>8a29f2b0288ba2a8fb302f9a639521ac9ff302e5</id>
<content type='text'>
Release the crypt_stat hash mutex on allocation error. Check for error
conditions when doing crypto hash calls.

Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Reported-by: Kazuki Ohta &lt;kazuki.ohta@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Release the crypt_stat hash mutex on allocation error. Check for error
conditions when doing crypto hash calls.

Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Reported-by: Kazuki Ohta &lt;kazuki.ohta@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>eCryptfs: increment extent_offset once per loop interation</title>
<updated>2007-11-05T23:12:33+00:00</updated>
<author>
<name>Michael Halcrow</name>
<email>mhalcrow@us.ibm.com</email>
</author>
<published>2007-11-05T22:51:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=778d1a2bd42ae862a6c6d20a1c3af5e45b3c1924'/>
<id>778d1a2bd42ae862a6c6d20a1c3af5e45b3c1924</id>
<content type='text'>
The extent_offset is getting incremented twice per loop iteration through any
given page.  It should only be getting incremented once.  This bug should only
impact hosts with &gt;4K page sizes.

Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The extent_offset is getting incremented twice per loop iteration through any
given page.  It should only be getting incremented once.  This bug should only
impact hosts with &gt;4K page sizes.

Signed-off-by: Michael Halcrow &lt;mhalcrow@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
