<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/fs/ecryptfs/crypto.c, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-07-26T07:13:06Z</updated>
<entry>
<title>eCryptfs: fix a couple type promotion bugs</title>
<updated>2019-07-26T07:13:06Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2018-07-04T09:35:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=26db170bfde4e0e0d7289c8493c622a298ca2264'/>
<id>urn:sha1:26db170bfde4e0e0d7289c8493c622a298ca2264</id>
<content type='text'>
commit 0bdf8a8245fdea6f075a5fede833a5fcf1b3466c upstream.

ECRYPTFS_SIZE_AND_MARKER_BYTES is type size_t, so if "rc" is negative
that gets type promoted to a high positive value and treated as success.

Fixes: 778aeb42a708 ("eCryptfs: Cleanup and optimize ecryptfs_lookup_interpose()")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
[tyhicks: Use "if/else if" rather than "if/if"]
Cc: stable@vger.kernel.org
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>crypto: clarify name of WEAK_KEY request flag</title>
<updated>2019-01-25T10:41:52Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2019-01-19T06:48:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=231baecdef7a906579925ccf1bd45aa734f32320'/>
<id>urn:sha1:231baecdef7a906579925ccf1bd45aa734f32320</id>
<content type='text'>
CRYPTO_TFM_REQ_WEAK_KEY confuses newcomers to the crypto API because it
sounds like it is requesting a weak key.  Actually, it is requesting
that weak keys be forbidden (for algorithms that have the notion of
"weak keys"; currently only DES and XTS do).

Also it is only one letter away from CRYPTO_TFM_RES_WEAK_KEY, with which
it can be easily confused.  (This in fact happened in the UX500 driver,
though just in some debugging messages.)

Therefore, make the intent clear by renaming it to
CRYPTO_TFM_REQ_FORBID_WEAK_KEYS.

Signed-off-by: Eric Biggers &lt;ebiggers@google.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>eCryptfs: don't pass up plaintext names when using filename encryption</title>
<updated>2018-04-16T18:51:22Z</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2018-03-28T23:41:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e86281e700cca8a773f9a572fa406adf2784ba5c'/>
<id>urn:sha1:e86281e700cca8a773f9a572fa406adf2784ba5c</id>
<content type='text'>
Both ecryptfs_filldir() and ecryptfs_readlink_lower() use
ecryptfs_decode_and_decrypt_filename() to translate lower filenames to
upper filenames. The function correctly passes up lower filenames,
unchanged, when filename encryption isn't in use. However, it was also
passing up lower filenames when the filename wasn't encrypted or
when decryption failed. Since 88ae4ab9802e, eCryptfs refuses to lookup
lower plaintext names when filename encryption is enabled so this
resulted in a situation where userspace would see lower plaintext
filenames in calls to getdents(2) but then not be able to lookup those
filenames.

An example of this can be seen when enabling filename encryption on an
eCryptfs mount at the root directory of an Ext4 filesystem:

$ ls -1i /lower
12 ECRYPTFS_FNEK_ENCRYPTED.FWYZD8TcW.5FV-TKTEYOHsheiHX9a-w.NURCCYIMjI8pn5BDB9-h3fXwrE--
11 lost+found
$ ls -1i /upper
ls: cannot access '/upper/lost+found': No such file or directory
 ? lost+found
12 test

With this change, the lower lost+found dentry is ignored:

$ ls -1i /lower
12 ECRYPTFS_FNEK_ENCRYPTED.FWYZD8TcW.5FV-TKTEYOHsheiHX9a-w.NURCCYIMjI8pn5BDB9-h3fXwrE--
11 lost+found
$ ls -1i /upper
12 test

Additionally, some potentially noisy error/info messages in the related
code paths are turned into debug messages so that the logs can't be
easily filled.

Fixes: 88ae4ab9802e ("ecryptfs_lookup(): try either only encrypted or plaintext name")
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
</entry>
<entry>
<title>ecryptfs: use ARRAY_SIZE</title>
<updated>2017-11-06T18:23:59Z</updated>
<author>
<name>Jérémy Lefaure</name>
<email>jeremy.lefaure@lse.epita.fr</email>
</author>
<published>2017-10-01T19:30:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=02f9876ebb5e9cd31013c62b8839508b2dc152f0'/>
<id>urn:sha1:02f9876ebb5e9cd31013c62b8839508b2dc152f0</id>
<content type='text'>
Using the ARRAY_SIZE macro improves the readability of the code.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
 (sizeof(E)@p /sizeof(*E))
|
 (sizeof(E)@p /sizeof(E[...]))
|
 (sizeof(E)@p /sizeof(T))
)

Signed-off-by: Jérémy Lefaure &lt;jeremy.lefaure@lse.epita.fr&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
</entry>
<entry>
<title>ecryptfs: Adjust four checks for null pointers</title>
<updated>2017-11-06T18:23:48Z</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2017-08-19T16:00:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5032f360dd31e6cf59aadad0478df1244bfd30f8'/>
<id>urn:sha1:5032f360dd31e6cf59aadad0478df1244bfd30f8</id>
<content type='text'>
The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written …

Thus fix the affected source code places.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
</entry>
<entry>
<title>ecryptfs: Delete 21 error messages for a failed memory allocation</title>
<updated>2017-11-06T18:23:29Z</updated>
<author>
<name>Markus Elfring</name>
<email>elfring@users.sourceforge.net</email>
</author>
<published>2017-08-19T15:37:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1a0bba4ff086d73a88f9dbadaf4831aefce55f27'/>
<id>urn:sha1:1a0bba4ff086d73a88f9dbadaf4831aefce55f27</id>
<content type='text'>
Omit extra messages for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring &lt;elfring@users.sourceforge.net&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
</entry>
<entry>
<title>ecryptfs: remove private bin2hex implementation</title>
<updated>2017-11-04T22:16:41Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2016-09-20T23:17:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=abbae6d560c1d562c5c0d10785469734784ef961'/>
<id>urn:sha1:abbae6d560c1d562c5c0d10785469734784ef961</id>
<content type='text'>
Calling sprintf in a loop is not very efficient, and in any case, we
already have an implementation of bin-to-hex conversion in lib/ which
we might as well use.

Note that ecryptfs_to_hex used to nul-terminate the destination (and
the kernel doc was wrong about the required output size), while
bin2hex doesn't. [All but one user of ecryptfs_to_hex explicitly
nul-terminates the result anyway.]

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
[tyhicks: Include &lt;linux/kernel.h&gt; in ecryptfs_kernel.h]
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
</entry>
<entry>
<title>ecryptfs: fix spelling mistakes</title>
<updated>2016-06-20T15:02:35Z</updated>
<author>
<name>Chris J Arges</name>
<email>chris.j.arges@canonical.com</email>
</author>
<published>2016-06-09T20:31:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=40f0fd372a623e8d32bae0b9361d2a7453ae7a2e'/>
<id>urn:sha1:40f0fd372a623e8d32bae0b9361d2a7453ae7a2e</id>
<content type='text'>
Noticed some minor spelling errors when looking through the code.

Signed-off-by: Chris J Arges &lt;chris.j.arges@canonical.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
</entry>
<entry>
<title>eCryptfs: fix typos in comment</title>
<updated>2016-06-20T15:02:23Z</updated>
<author>
<name>Wei Yuan</name>
<email>weiyuan.wei@huawei.com</email>
</author>
<published>2016-02-17T06:50:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5f9f2c2abd16fcea6cf7cf87791a24687e2fc345'/>
<id>urn:sha1:5f9f2c2abd16fcea6cf7cf87791a24687e2fc345</id>
<content type='text'>
Signed-off-by: Weiyuan &lt;weiyuan.wei@huawei.com&gt;
Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
</content>
</entry>
<entry>
<title>switch -&gt;setxattr() to passing dentry and inode separately</title>
<updated>2016-05-28T00:09:16Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2016-05-27T15:06:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3767e255b390d72f9a33c08d9e86c5f21f25860f'/>
<id>urn:sha1:3767e255b390d72f9a33c08d9e86c5f21f25860f</id>
<content type='text'>
smack -&gt;d_instantiate() uses -&gt;setxattr(), so to be able to call it before
we'd hashed the new dentry and attached it to inode, we need -&gt;setxattr()
instances getting the inode as an explicit argument rather than obtaining
it from dentry.

Similar change for -&gt;getxattr() had been done in commit ce23e64.  Unlike
-&gt;getxattr() (which is used by both selinux and smack instances of
-&gt;d_instantiate()) -&gt;setxattr() is used only by smack one and unfortunately
it got missed back then.

Reported-by: Seung-Woo Kim &lt;sw0312.kim@samsung.com&gt;
Tested-by: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
