<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/crypto, branch v4.20</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.20</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.20'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-12-07T05:56:08Z</updated>
<entry>
<title>crypto: user - Disable statistics interface</title>
<updated>2018-12-07T05:56:08Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2018-12-07T05:56:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e61efff4ae94f4509707a5e03f8edb6455f490e1'/>
<id>urn:sha1:e61efff4ae94f4509707a5e03f8edb6455f490e1</id>
<content type='text'>
Since this user-space API is still undergoing significant changes,
this patch disables it for the current merge window.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: do not free algorithm before using</title>
<updated>2018-11-29T06:53:59Z</updated>
<author>
<name>Pan Bian</name>
<email>bianpan2016@163.com</email>
</author>
<published>2018-11-22T10:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e5bde04ccce64d808f8b00a489a1fe5825d285cb'/>
<id>urn:sha1:e5bde04ccce64d808f8b00a489a1fe5825d285cb</id>
<content type='text'>
In multiple functions, the algorithm fields are read after its reference
is dropped through crypto_mod_put. In this case, the algorithm memory
may be freed, resulting in use-after-free bugs. This patch delays the
put operation until the algorithm is never used.

Fixes: 79c65d179a40 ("crypto: cbc - Convert to skcipher")
Fixes: a7d85e06ed80 ("crypto: cfb - add support for Cipher FeedBack mode")
Fixes: 043a44001b9e ("crypto: pcbc - Convert to skcipher")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Pan Bian &lt;bianpan2016@163.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: user - Zeroize whole structure given to user space</title>
<updated>2018-11-09T09:35:43Z</updated>
<author>
<name>Corentin Labbe</name>
<email>clabbe@baylibre.com</email>
</author>
<published>2018-11-03T21:56:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9f4debe38415583086ce814798eeb864aeb39551'/>
<id>urn:sha1:9f4debe38415583086ce814798eeb864aeb39551</id>
<content type='text'>
For preventing uninitialized data to be given to user-space (and so leak
potential useful data), the crypto_stat structure must be correctly
initialized.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Fixes: cac5818c25d0 ("crypto: user - Implement a generic crypto statistics")
Signed-off-by: Corentin Labbe &lt;clabbe@baylibre.com&gt;
[EB: also fix it in crypto_reportstat_one()]
[EB: use sizeof(var) rather than sizeof(type)]
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>crypto: user - fix leaking uninitialized memory to userspace</title>
<updated>2018-11-09T09:35:43Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@google.com</email>
</author>
<published>2018-11-03T21:56:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f43f39958beb206b53292801e216d9b8a660f087'/>
<id>urn:sha1:f43f39958beb206b53292801e216d9b8a660f087</id>
<content type='text'>
All bytes of the NETLINK_CRYPTO report structures must be initialized,
since they are copied to userspace.  The change from strncpy() to
strlcpy() broke this.  As a minimal fix, change it back.

Fixes: 4473710df1f8 ("crypto: user - Prepare for CRYPTO_MAX_ALG_NAME expansion")
Cc: &lt;stable@vger.kernel.org&gt; # v4.12+
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>crypto: simd - correctly take reqsize of wrapped skcipher into account</title>
<updated>2018-11-09T09:35:43Z</updated>
<author>
<name>Ard Biesheuvel</name>
<email>ard.biesheuvel@linaro.org</email>
</author>
<published>2018-11-08T22:55:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=508a1c4df085a547187eed346f1bfe5e381797f1'/>
<id>urn:sha1:508a1c4df085a547187eed346f1bfe5e381797f1</id>
<content type='text'>
The simd wrapper's skcipher request context structure consists
of a single subrequest whose size is taken from the subordinate
skcipher. However, in simd_skcipher_init(), the reqsize that is
retrieved is not from the subordinate skcipher but from the
cryptd request structure, whose size is completely unrelated to
the actual wrapped skcipher.

Reported-by: Qian Cai &lt;cai@gmx.us&gt;
Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Tested-by: Qian Cai &lt;cai@gmx.us&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>KEYS: asym_tpm: Add support for the sign operation [ver #2]</title>
<updated>2018-10-26T08:30:47Z</updated>
<author>
<name>Denis Kenzior</name>
<email>denkenz@gmail.com</email>
</author>
<published>2018-10-09T16:49:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=64ae16dfeefec670276607fa789ce096c7ebd7c4'/>
<id>urn:sha1:64ae16dfeefec670276607fa789ce096c7ebd7c4</id>
<content type='text'>
The sign operation can operate in a non-hashed mode by running the RSA
sign operation directly on the input.  This assumes that the input is
less than key_size_in_bytes - 11.  Since the TPM performs its own PKCS1
padding, it isn't possible to support 'raw' mode, only 'pkcs1'.

Alternatively, a hashed version is also possible.  In this variant the
input is hashed (by userspace) via the selected hash function first.
Then this implementation takes care of converting the hash to ASN.1
format and the sign operation is performed on the result.  This is
similar to the implementation inside crypto/rsa-pkcs1pad.c.

ASN1 templates were copied from crypto/rsa-pkcs1pad.c.  There seems to
be no easy way to expose that functionality, but likely the templates
should be shared somehow.

The sign operation is implemented via TPM_Sign operation on the TPM.
It is assumed that the TPM wrapped key provided uses
TPM_SS_RSASSAPKCS1v15_DER signature scheme.  This allows the TPM_Sign
operation to work on data up to key_len_in_bytes - 11 bytes long.

In theory, we could also use TPM_Unbind instead of TPM_Sign, but we would
have to manually pkcs1 pad the digest first.

Signed-off-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>KEYS: asym_tpm: Implement tpm_sign [ver #2]</title>
<updated>2018-10-26T08:30:47Z</updated>
<author>
<name>Denis Kenzior</name>
<email>denkenz@gmail.com</email>
</author>
<published>2018-10-09T16:49:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e73d170f6c77e7006b48c5e9c325fe520f6012ca'/>
<id>urn:sha1:e73d170f6c77e7006b48c5e9c325fe520f6012ca</id>
<content type='text'>
Signed-off-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>KEYS: asym_tpm: Implement signature verification [ver #2]</title>
<updated>2018-10-26T08:30:47Z</updated>
<author>
<name>Denis Kenzior</name>
<email>denkenz@gmail.com</email>
</author>
<published>2018-10-09T16:49:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e08e6891231f5fae82a6ffb4affdfa2ced8c1a77'/>
<id>urn:sha1:e08e6891231f5fae82a6ffb4affdfa2ced8c1a77</id>
<content type='text'>
This patch implements the verify_signature operation.  The public key
portion extracted from the TPM key blob is used.  The operation is
performed entirely in software using the crypto API.

Signed-off-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>KEYS: asym_tpm: Implement the decrypt operation [ver #2]</title>
<updated>2018-10-26T08:30:47Z</updated>
<author>
<name>Denis Kenzior</name>
<email>denkenz@gmail.com</email>
</author>
<published>2018-10-09T16:49:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a335974ae0883e045151a2160093a22aa02c3626'/>
<id>urn:sha1:a335974ae0883e045151a2160093a22aa02c3626</id>
<content type='text'>
This patch implements the pkey_decrypt operation using the private key
blob.  The blob is first loaded into the TPM via tpm_loadkey2.  Once the
handle is obtained, tpm_unbind operation is used to decrypt the data on
the TPM and the result is returned.  The key loaded by tpm_loadkey2 is
then evicted via tpm_flushspecific operation.

This patch assumes that the SRK authorization is a well known 20-byte of
zeros and the same holds for the key authorization of the provided key.

Signed-off-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>KEYS: asym_tpm: Implement tpm_unbind [ver #2]</title>
<updated>2018-10-26T08:30:47Z</updated>
<author>
<name>Denis Kenzior</name>
<email>denkenz@gmail.com</email>
</author>
<published>2018-10-09T16:49:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f884fe5a158f750e232b029e1fac0283e388e062'/>
<id>urn:sha1:f884fe5a158f750e232b029e1fac0283e388e062</id>
<content type='text'>
Signed-off-by: Denis Kenzior &lt;denkenz@gmail.com&gt;
Reviewed-by: James Morris &lt;james.morris@microsoft.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Tested-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Reviewed-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
</feed>
