<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/crypto, branch v3.18.40</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.40</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.18.40'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-07-11T15:16:08Z</updated>
<entry>
<title>crypto: ux500 - memmove the right size</title>
<updated>2016-07-11T15:16:08Z</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2016-06-08T12:56:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e0f24364aa5f560ff80035f625a7a1b287893848'/>
<id>urn:sha1:e0f24364aa5f560ff80035f625a7a1b287893848</id>
<content type='text'>
[ Upstream commit 19ced623db2fe91604d69f7d86b03144c5107739 ]

The hash buffer is really HASH_BLOCK_SIZE bytes, someone
must have thought that memmove takes n*u32 words by mistake.
Tests work as good/bad as before after this patch.

Cc: Joakim Bech &lt;joakim.bech@linaro.org&gt;
Cc: stable@vger.kernel.org
Reported-by: David Binderman &lt;linuxdev.baldrick@gmail.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Fix AES XTS error for request sizes above 4096</title>
<updated>2016-06-18T20:52:51Z</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2016-05-20T22:33:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ce0cad42490c559fc3ca204bb6f5a581f6ef5573'/>
<id>urn:sha1:ce0cad42490c559fc3ca204bb6f5a581f6ef5573</id>
<content type='text'>
[ Upstream commit ab6a11a7c8ef47f996974dd3c648c2c0b1a36ab1 ]

The ccp-crypto module for AES XTS support has a bug that can allow requests
greater than 4096 bytes in size to be passed to the CCP hardware. The CCP
hardware does not support request sizes larger than 4096, resulting in
incorrect output. The request should actually be handled by the fallback
mechanism instantiated by the ccp-crypto module.

Add a check to insure the request size is less than or equal to the maximum
supported size and use the fallback mechanism if it is not.

Cc: &lt;stable@vger.kernel.org&gt; # 3.14.x-
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: caam - fix caam_jr_alloc() ret code</title>
<updated>2016-06-06T23:11:01Z</updated>
<author>
<name>Catalin Vasile</name>
<email>cata.vasile@nxp.com</email>
</author>
<published>2016-05-06T13:18:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ec08049bd9820dd7c95235ba7b8c7ccabfda824d'/>
<id>urn:sha1:ec08049bd9820dd7c95235ba7b8c7ccabfda824d</id>
<content type='text'>
[ Upstream commit e930c765ca5c6b039cd22ebfb4504ea7b5dab43d ]

caam_jr_alloc() used to return NULL if a JR device could not be
allocated for a session. In turn, every user of this function used
IS_ERR() function to verify if anything went wrong, which does NOT look
for NULL values. This made the kernel crash if the sanity check failed,
because the driver continued to think it had allocated a valid JR dev
instance to the session and at some point it tries to do a caam_jr_free()
on a NULL JR dev pointer.
This patch is a fix for this issue.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Catalin Vasile &lt;cata.vasile@nxp.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: s5p-sss - Fix missed interrupts when working with 8 kB blocks</title>
<updated>2016-06-03T15:30:28Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2016-04-22T12:15:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=219e2a9492b00083f1386ddc978f8c8de726c591'/>
<id>urn:sha1:219e2a9492b00083f1386ddc978f8c8de726c591</id>
<content type='text'>
[ Upstream commit 79152e8d085fd64484afd473ef6830b45518acba ]

The tcrypt testing module on Exynos5422-based Odroid XU3/4 board failed on
testing 8 kB size blocks:

	$ sudo modprobe tcrypt sec=1 mode=500
	testing speed of async ecb(aes) (ecb-aes-s5p) encryption
	test 0 (128 bit key, 16 byte blocks): 21971 operations in 1 seconds (351536 bytes)
	test 1 (128 bit key, 64 byte blocks): 21731 operations in 1 seconds (1390784 bytes)
	test 2 (128 bit key, 256 byte blocks): 21932 operations in 1 seconds (5614592 bytes)
	test 3 (128 bit key, 1024 byte blocks): 21685 operations in 1 seconds (22205440 bytes)
	test 4 (128 bit key, 8192 byte blocks):

This was caused by a race issue of missed BRDMA_DONE ("Block cipher
Receiving DMA") interrupt. Device starts processing the data in DMA mode
immediately after setting length of DMA block: receiving (FCBRDMAL) or
transmitting (FCBTDMAL). The driver sets these lengths from interrupt
handler through s5p_set_dma_indata() function (or xxx_setdata()).

However the interrupt handler was first dealing with receive buffer
(dma-unmap old, dma-map new, set receive block length which starts the
operation), then with transmit buffer and finally was clearing pending
interrupts (FCINTPEND). Because of the time window between setting
receive buffer length and clearing pending interrupts, the operation on
receive buffer could end already and driver would miss new interrupt.

User manual for Exynos5422 confirms in example code that setting DMA
block lengths should be the last operation.

The tcrypt hang could be also observed in following blocked-task dmesg:

INFO: task modprobe:258 blocked for more than 120 seconds.
      Not tainted 4.6.0-rc4-next-20160419-00005-g9eac8b7b7753-dirty #42
"echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
modprobe        D c06b09d8     0   258    256 0x00000000
[&lt;c06b09d8&gt;] (__schedule) from [&lt;c06b0f24&gt;] (schedule+0x40/0xac)
[&lt;c06b0f24&gt;] (schedule) from [&lt;c06b49f8&gt;] (schedule_timeout+0x124/0x178)
[&lt;c06b49f8&gt;] (schedule_timeout) from [&lt;c06b17fc&gt;] (wait_for_common+0xb8/0x144)
[&lt;c06b17fc&gt;] (wait_for_common) from [&lt;bf0013b8&gt;] (test_acipher_speed+0x49c/0x740 [tcrypt])
[&lt;bf0013b8&gt;] (test_acipher_speed [tcrypt]) from [&lt;bf003e8c&gt;] (do_test+0x2240/0x30ec [tcrypt])
[&lt;bf003e8c&gt;] (do_test [tcrypt]) from [&lt;bf008048&gt;] (tcrypt_mod_init+0x48/0xa4 [tcrypt])
[&lt;bf008048&gt;] (tcrypt_mod_init [tcrypt]) from [&lt;c010177c&gt;] (do_one_initcall+0x3c/0x16c)
[&lt;c010177c&gt;] (do_one_initcall) from [&lt;c0191ff0&gt;] (do_init_module+0x5c/0x1ac)
[&lt;c0191ff0&gt;] (do_init_module) from [&lt;c0185610&gt;] (load_module+0x1a30/0x1d08)
[&lt;c0185610&gt;] (load_module) from [&lt;c0185ab0&gt;] (SyS_finit_module+0x8c/0x98)
[&lt;c0185ab0&gt;] (SyS_finit_module) from [&lt;c01078c0&gt;] (ret_fast_syscall+0x0/0x3c)

Fixes: a49e490c7a8a ("crypto: s5p-sss - add S5PV210 advanced crypto engine support")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: s5p-sss - Remove useless hash interrupt handler</title>
<updated>2016-06-03T15:30:28Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2016-04-19T13:44:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=24196446b4f5e5f8fb8bcfba155d2ebfbb7876ab'/>
<id>urn:sha1:24196446b4f5e5f8fb8bcfba155d2ebfbb7876ab</id>
<content type='text'>
[ Upstream commit 5512442553bbe8d4fcdba3e17b30f187706384a7 ]

Beside regular feed control interrupt, the driver requires also hash
interrupt for older SoCs (samsung,s5pv210-secss). However after
requesting it, the interrupt handler isn't doing anything with it, not
even clearing the hash interrupt bit.

Driver does not provide hash functions so it is safe to remove the hash
interrupt related code and to not require the interrupt in Device Tree.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Prevent information leakage on export</title>
<updated>2016-05-09T01:21:51Z</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2016-04-13T15:52:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1e53b1951e8a48266144d3a79a6a03950111b717'/>
<id>urn:sha1:1e53b1951e8a48266144d3a79a6a03950111b717</id>
<content type='text'>
[ Upstream commit f709b45ec461b548c41a00044dba1f1b572783bf ]

Prevent information from leaking to userspace by doing a memset to 0 of
the export state structure before setting the structure values and copying
it. This prevents un-initialized padding areas from being copied into the
export area.

Cc: &lt;stable@vger.kernel.org&gt; # 3.14.x-
Reported-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - memset request context to zero during import</title>
<updated>2016-04-18T12:49:19Z</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2016-02-25T22:48:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ead3fd505c30494ef27420c3ef70f42cb13ff5de'/>
<id>urn:sha1:ead3fd505c30494ef27420c3ef70f42cb13ff5de</id>
<content type='text'>
[ Upstream commit ce0ae266feaf35930394bd770c69778e4ef03ba9 ]

Since a crypto_ahash_import() can be called against a request context
that has not had a crypto_ahash_init() performed, the request context
needs to be cleared to insure there is no random data present. If not,
the random data can result in a kernel oops during crypto_ahash_update().

Cc: &lt;stable@vger.kernel.org&gt; # 3.14.x-
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Don't assume export/import areas are aligned</title>
<updated>2016-04-12T13:10:24Z</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2016-02-02T17:38:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=52a497f9b5f1cfc5a2fbb507fbc4832f43e6a93b'/>
<id>urn:sha1:52a497f9b5f1cfc5a2fbb507fbc4832f43e6a93b</id>
<content type='text'>
[ Upstream commit b31dde2a5cb1bf764282abf934266b7193c2bc7c ]

Use a local variable for the exported and imported state so that
alignment is not an issue. On export, set a local variable from the
request context and then memcpy the contents of the local variable to
the export memory area. On import, memcpy the import memory area into
a local variable and then use the local variable to set the request
context.

Cc: &lt;stable@vger.kernel.org&gt; # 3.14.x-
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Limit the amount of information exported</title>
<updated>2016-04-12T13:10:19Z</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2016-01-29T18:45:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=eabdb09463bb2474b8b47dffea3a0231671aaaa4'/>
<id>urn:sha1:eabdb09463bb2474b8b47dffea3a0231671aaaa4</id>
<content type='text'>
[ Upstream commit d1662165ae612ec8b5f94a6b07e65ea58b6dce34 ]

Since the exported information can be exposed to user-space, instead of
exporting the entire request context only export the minimum information
needed.

Cc: &lt;stable@vger.kernel.org&gt; # 3.14.x-
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>crypto: ccp - Add hash state import and export support</title>
<updated>2016-04-12T13:09:56Z</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2016-01-12T17:17:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=597a8627d548be5127c774aa0c1204ec04e8b764'/>
<id>urn:sha1:597a8627d548be5127c774aa0c1204ec04e8b764</id>
<content type='text'>
[ Upstream commit 952bce9792e6bf36fda09c2e5718abb5d9327369 ]

Commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero")
added a check to prevent ahash algorithms from successfully registering
if the import and export functions were not implemented. This prevents
an oops in the hash_accept function of algif_hash. This commit causes
the ccp-crypto module SHA support and AES CMAC support from successfully
registering and causing the ccp-crypto module load to fail because the
ahash import and export functions are not implemented.

Update the CCP Crypto API support to provide import and export support
for ahash algorithms.

Cc: &lt;stable@vger.kernel.org&gt; # 3.14.x-
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
</feed>
