<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/crypto, branch v4.9</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.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-12-10T17:47:13Z</updated>
<entry>
<title>Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6</title>
<updated>2016-12-10T17:47:13Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-12-10T17:47:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=045169816b31b10faed984b01c390db1b32ee4c1'/>
<id>urn:sha1:045169816b31b10faed984b01c390db1b32ee4c1</id>
<content type='text'>
Pull crypto fixes from Herbert Xu:
 "This fixes the following issues:

   - Fix pointer size when caam is used with AArch64 boot loader on
     AArch32 kernel.

   - Fix ahash state corruption in marvell driver.

   - Fix buggy algif_aed tag handling.

   - Prevent mcryptd from being used with incompatible algorithms which
     can cause crashes"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: algif_aead - fix uninitialized variable warning
  crypto: mcryptd - Check mcryptd algorithm compatibility
  crypto: algif_aead - fix AEAD tag memory handling
  crypto: caam - fix pointer size for AArch64 boot loader, AArch32 kernel
  crypto: marvell - Don't corrupt state of an STD req for re-stepped ahash
  crypto: marvell - Don't copy hash operation twice into the SRAM
</content>
</entry>
<entry>
<title>crypto: algif_aead - fix uninitialized variable warning</title>
<updated>2016-12-08T12:09:22Z</updated>
<author>
<name>Stephan Mueller</name>
<email>smueller@chronox.de</email>
</author>
<published>2016-12-08T06:09:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=678b5c6b22fed89a13d5b2267f423069a9b11c80'/>
<id>urn:sha1:678b5c6b22fed89a13d5b2267f423069a9b11c80</id>
<content type='text'>
In case the user provided insufficient data, the code may return
prematurely without any operation. In this case, the processed
data indicated with outlen is zero.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Stephan Mueller &lt;smueller@chronox.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: mcryptd - Check mcryptd algorithm compatibility</title>
<updated>2016-12-07T11:55:37Z</updated>
<author>
<name>tim</name>
<email>tim.c.chen@linux.intel.com</email>
</author>
<published>2016-12-05T19:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48a992727d82cb7db076fa15d372178743b1f4cd'/>
<id>urn:sha1:48a992727d82cb7db076fa15d372178743b1f4cd</id>
<content type='text'>
Algorithms not compatible with mcryptd could be spawned by mcryptd
with a direct crypto_alloc_tfm invocation using a "mcryptd(alg)" name
construct.  This causes mcryptd to crash the kernel if an arbitrary
"alg" is incompatible and not intended to be used with mcryptd.  It is
an issue if AF_ALG tries to spawn mcryptd(alg) to expose it externally.
But such algorithms must be used internally and not be exposed.

We added a check to enforce that only internal algorithms are allowed
with mcryptd at the time mcryptd is spawning an algorithm.

Link: http://marc.info/?l=linux-crypto-vger&amp;m=148063683310477&amp;w=2
Cc: stable@vger.kernel.org
Reported-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Tim Chen &lt;tim.c.chen@linux.intel.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: algif_aead - fix AEAD tag memory handling</title>
<updated>2016-12-07T11:55:36Z</updated>
<author>
<name>Stephan Mueller</name>
<email>smueller@chronox.de</email>
</author>
<published>2016-12-05T14:26:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0c1e16cd1ec41987cc6671a2bff46ac958c41eb5'/>
<id>urn:sha1:0c1e16cd1ec41987cc6671a2bff46ac958c41eb5</id>
<content type='text'>
For encryption, the AEAD ciphers require AAD || PT as input and generate
AAD || CT || Tag as output and vice versa for decryption. Prior to this
patch, the AF_ALG interface for AEAD ciphers requires the buffer to be
present as input for encryption. Similarly, the output buffer for
decryption required the presence of the tag buffer too. This implies
that the kernel reads / writes data buffers from/to kernel space
even though this operation is not required.

This patch changes the AF_ALG AEAD interface to be consistent with the
in-kernel AEAD cipher requirements.

Due to this handling, he changes are transparent to user space with one
exception: the return code of recv indicates the mount of output buffer.
That output buffer has a different size compared to before the patch
which implies that the return code of recv will also be different.
For example, a decryption operation uses 16 bytes AAD, 16 bytes CT and
16 bytes tag, the AF_ALG AEAD interface before showed a recv return
code of 48 (bytes) whereas after this patch, the return code is 32
since the tag is not returned any more.

Reported-by: Mat Martineau &lt;mathew.j.martineau@linux.intel.com&gt;
Signed-off-by: Stephan Mueller &lt;smueller@chronox.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6</title>
<updated>2016-12-05T17:16:10Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-12-05T17:16:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ef3263e35e26eb1061260131c4d6d579eea21f85'/>
<id>urn:sha1:ef3263e35e26eb1061260131c4d6d579eea21f85</id>
<content type='text'>
Pull crypto fixes from Herbert Xu:
 "This fixes the following issues:

   - Intermittent build failure in RSA

   - Memory corruption in chelsio crypto driver

   - Regression in DRBG due to vmalloced stack"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: rsa - Add Makefile dependencies to fix parallel builds
  crypto: chcr - Fix memory corruption
  crypto: drbg - prevent invalid SG mappings
</content>
</entry>
<entry>
<title>crypto: rsa - Add Makefile dependencies to fix parallel builds</title>
<updated>2016-11-30T11:46:45Z</updated>
<author>
<name>David Michael</name>
<email>david.michael@coreos.com</email>
</author>
<published>2016-11-29T19:15:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=57891633eeef60e732e045731cf20e50ee80acb4'/>
<id>urn:sha1:57891633eeef60e732e045731cf20e50ee80acb4</id>
<content type='text'>
Both asn1 headers are included by rsa_helper.c, so rsa_helper.o
should explicitly depend on them.

Signed-off-by: David Michael &lt;david.michael@coreos.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: drbg - prevent invalid SG mappings</title>
<updated>2016-11-30T11:46:44Z</updated>
<author>
<name>Stephan Mueller</name>
<email>smueller@chronox.de</email>
</author>
<published>2016-11-29T08:45:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5102981212454998d549273ff9847f19e97a1794'/>
<id>urn:sha1:5102981212454998d549273ff9847f19e97a1794</id>
<content type='text'>
When using SGs, only heap memory (memory that is valid as per
virt_addr_valid) is allowed to be referenced. The CTR DRBG used to
reference the caller-provided memory directly in an SG. In case the
caller provided stack memory pointers, the SG mapping is not considered
to be valid. In some cases, this would even cause a paging fault.

The change adds a new scratch buffer that is used unconditionally to
catch the cases where the caller-provided buffer is not suitable for
use in an SG. The crypto operation of the CTR DRBG produces its output
with that scratch buffer and finally copies the content of the
scratch buffer to the caller's buffer.

The scratch buffer is allocated during allocation time of the CTR DRBG
as its access is protected with the DRBG mutex.

Signed-off-by: Stephan Mueller &lt;smueller@chronox.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>X.509: Fix double free in x509_cert_parse() [ver #3]</title>
<updated>2016-11-25T01:57:48Z</updated>
<author>
<name>Andrey Ryabinin</name>
<email>aryabinin@virtuozzo.com</email>
</author>
<published>2016-11-24T13:23:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2b95fda2c4fcb6d6625963f889247538f247fce0'/>
<id>urn:sha1:2b95fda2c4fcb6d6625963f889247538f247fce0</id>
<content type='text'>
We shouldn't free cert-&gt;pub-&gt;key in x509_cert_parse() because
x509_free_certificate() also does this:
	BUG: Double free or freeing an invalid pointer
	...
	Call Trace:
	 [&lt;ffffffff81896c20&gt;] dump_stack+0x63/0x83
	 [&lt;ffffffff81356571&gt;] kasan_object_err+0x21/0x70
	 [&lt;ffffffff81356ed9&gt;] kasan_report_double_free+0x49/0x60
	 [&lt;ffffffff813561ad&gt;] kasan_slab_free+0x9d/0xc0
	 [&lt;ffffffff81350b7a&gt;] kfree+0x8a/0x1a0
	 [&lt;ffffffff81844fbf&gt;] public_key_free+0x1f/0x30
	 [&lt;ffffffff818455d4&gt;] x509_free_certificate+0x24/0x90
	 [&lt;ffffffff818460bc&gt;] x509_cert_parse+0x2bc/0x300
	 [&lt;ffffffff81846cae&gt;] x509_key_preparse+0x3e/0x330
	 [&lt;ffffffff818444cf&gt;] asymmetric_key_preparse+0x6f/0x100
	 [&lt;ffffffff8178bec0&gt;] key_create_or_update+0x260/0x5f0
	 [&lt;ffffffff8178e6d9&gt;] SyS_add_key+0x199/0x2a0
	 [&lt;ffffffff821d823b&gt;] entry_SYSCALL_64_fastpath+0x1e/0xad
	Object at ffff880110bd1900, in cache kmalloc-512 size: 512
	....
	Freed:
	PID = 2579
	[&lt;ffffffff8104283b&gt;] save_stack_trace+0x1b/0x20
	[&lt;ffffffff813558f6&gt;] save_stack+0x46/0xd0
	[&lt;ffffffff81356183&gt;] kasan_slab_free+0x73/0xc0
	[&lt;ffffffff81350b7a&gt;] kfree+0x8a/0x1a0
	[&lt;ffffffff818460a3&gt;] x509_cert_parse+0x2a3/0x300
	[&lt;ffffffff81846cae&gt;] x509_key_preparse+0x3e/0x330
	[&lt;ffffffff818444cf&gt;] asymmetric_key_preparse+0x6f/0x100
	[&lt;ffffffff8178bec0&gt;] key_create_or_update+0x260/0x5f0
	[&lt;ffffffff8178e6d9&gt;] SyS_add_key+0x199/0x2a0
	[&lt;ffffffff821d823b&gt;] entry_SYSCALL_64_fastpath+0x1e/0xad

Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api")
Signed-off-by: Andrey Ryabinin &lt;aryabinin@virtuozzo.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: scatterwalk - Remove unnecessary aliasing check in map_and_copy</title>
<updated>2016-11-22T07:02:25Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2016-11-21T08:26:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c8467f7a3620698bf3c22f0e199b550fb611a8ae'/>
<id>urn:sha1:c8467f7a3620698bf3c22f0e199b550fb611a8ae</id>
<content type='text'>
The aliasing check in map_and_copy is no longer necessary because
the IPsec ESP code no longer provides an IV that points into the
actual request data.  As this check is now triggering BUG checks
due to the vmalloced stack code, I'm removing it.

Reported-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: algif_hash - Fix result clobbering in recvmsg</title>
<updated>2016-11-22T07:02:24Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2016-11-21T07:34:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8acf7a106326eb94e143552de81f34308149121c'/>
<id>urn:sha1:8acf7a106326eb94e143552de81f34308149121c</id>
<content type='text'>
Recently an init call was added to hash_recvmsg so as to reset
the hash state in case a sendmsg call was never made.

Unfortunately this ended up clobbering the result if the previous
sendmsg was done with a MSG_MORE flag.  This patch fixes it by
excluding that case when we make the init call.

Fixes: a8348bca2944 ("algif_hash - Fix NULL hash crash with shash")
Reported-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
