<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/crypto, branch v3.12.34</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.34</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.12.34'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-11-19T17:38:15Z</updated>
<entry>
<title>crypto: caam - remove duplicated sg copy functions</title>
<updated>2014-11-19T17:38:15Z</updated>
<author>
<name>Cristian Stoica</name>
<email>cristian.stoica@freescale.com</email>
</author>
<published>2014-08-14T10:51:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e5fbc698350a42a56f5c165dbb6283d69b65d3f3'/>
<id>urn:sha1:e5fbc698350a42a56f5c165dbb6283d69b65d3f3</id>
<content type='text'>
commit 307fd543f3d23f8f56850eca1b27b1be2fe71017 upstream.

Replace equivalent (and partially incorrect) scatter-gather functions
with ones from crypto-API.

The replacement is motivated by page-faults in sg_copy_part triggered
by successive calls to crypto_hash_update. The following fault appears
after calling crypto_ahash_update twice, first with 13 and then
with 285 bytes:

Unable to handle kernel paging request for data at address 0x00000008
Faulting instruction address: 0xf9bf9a8c
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=8 CoreNet Generic
Modules linked in: tcrypt(+) caamhash caam_jr caam tls
CPU: 6 PID: 1497 Comm: cryptomgr_test Not tainted
3.12.19-rt30-QorIQ-SDK-V1.6+g9fda9f2 #75
task: e9308530 ti: e700e000 task.ti: e700e000
NIP: f9bf9a8c LR: f9bfcf28 CTR: c0019ea0
REGS: e700fb80 TRAP: 0300   Not tainted
(3.12.19-rt30-QorIQ-SDK-V1.6+g9fda9f2)
MSR: 00029002 &lt;CE,EE,ME&gt;  CR: 44f92024  XER: 20000000
DEAR: 00000008, ESR: 00000000

GPR00: f9bfcf28 e700fc30 e9308530 e70b1e55 00000000 ffffffdd e70b1e54 0bebf888
GPR08: 902c7ef5 c0e771e2 00000002 00000888 c0019ea0 00000000 00000000 c07a4154
GPR16: c08d0000 e91a8f9c 00000001 e98fb400 00000100 e9c83028 e70b1e08 e70b1d48
GPR24: e992ce10 e70b1dc8 f9bfe4f4 e70b1e55 ffffffdd e70b1ce0 00000000 00000000
NIP [f9bf9a8c] sg_copy+0x1c/0x100 [caamhash]
LR [f9bfcf28] ahash_update_no_ctx+0x628/0x660 [caamhash]
Call Trace:
[e700fc30] [f9bf9c50] sg_copy_part+0xe0/0x160 [caamhash] (unreliable)
[e700fc50] [f9bfcf28] ahash_update_no_ctx+0x628/0x660 [caamhash]
[e700fcb0] [f954e19c] crypto_tls_genicv+0x13c/0x300 [tls]
[e700fd10] [f954e65c] crypto_tls_encrypt+0x5c/0x260 [tls]
[e700fd40] [c02250ec] __test_aead.constprop.9+0x2bc/0xb70
[e700fe40] [c02259f0] alg_test_aead+0x50/0xc0
[e700fe60] [c02241e4] alg_test+0x114/0x2e0
[e700fee0] [c022276c] cryptomgr_test+0x4c/0x60
[e700fef0] [c004f658] kthread+0x98/0xa0
[e700ff40] [c000fd04] ret_from_kernel_thread+0x5c/0x64

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: Cristian Stoica &lt;cristian.stoica@freescale.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>crypto: ux500 - make interrupt mode plausible</title>
<updated>2014-09-03T19:31:25Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2014-06-26T11:43:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9cf85b64836c89aea19de2c65954388d180bd56a'/>
<id>urn:sha1:9cf85b64836c89aea19de2c65954388d180bd56a</id>
<content type='text'>
commit e1f8859ee265fc89bd21b4dca79e8e983a044892 upstream.

The interrupt handler in the ux500 crypto driver has an obviously
incorrect way to access the data buffer, which for a while has
caused this build warning:

../ux500/cryp/cryp_core.c: In function 'cryp_interrupt_handler':
../ux500/cryp/cryp_core.c:234:5: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast [enabled by default]
     writel_relaxed(ctx-&gt;indata,
     ^
In file included from ../include/linux/swab.h:4:0,
                 from ../include/uapi/linux/byteorder/big_endian.h:12,
                 from ../include/linux/byteorder/big_endian.h:4,
                 from ../arch/arm/include/uapi/asm/byteorder.h:19,
                 from ../include/asm-generic/bitops/le.h:5,
                 from ../arch/arm/include/asm/bitops.h:340,
                 from ../include/linux/bitops.h:33,
                 from ../include/linux/kernel.h:10,
                 from ../include/linux/clk.h:16,
                 from ../drivers/crypto/ux500/cryp/cryp_core.c:12:
../include/uapi/linux/swab.h:57:119: note: expected '__u32' but argument is of type 'const u8 *'
 static inline __attribute_const__ __u32 __fswab32(__u32 val)

There are at least two, possibly three problems here:
a) when writing into the FIFO, we copy the pointer rather than the
   actual data we want to give to the hardware
b) the data pointer is an array of 8-bit values, while the FIFO
   is 32-bit wide, so both the read and write access fail to do
   a proper type conversion
c) This seems incorrect for big-endian kernels, on which we need to
   byte-swap any register access, but not normally FIFO accesses,
   at least the DMA case doesn't do it either.

This converts the bogus loop to use the same readsl/writesl pair
that we use for the two other modes (DMA and polling). This is
more efficient and consistent, and probably correct for endianess.

The bug has existed since the driver was first merged, and was
probably never detected because nobody tried to use interrupt mode.
It might make sense to backport this fix to stable kernels, depending
on how the crypto maintainers feel about that.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: linux-crypto@vger.kernel.org
Cc: Fabio Baltieri &lt;fabio.baltieri@linaro.org&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>crypto: caam - add allocation failure handling in SPRINTFCAT macro</title>
<updated>2014-06-09T13:53:55Z</updated>
<author>
<name>Horia Geanta</name>
<email>horia.geanta@freescale.com</email>
</author>
<published>2014-04-18T10:01:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2f152373bd3e3fc52dccae4322d2de7fd6467815'/>
<id>urn:sha1:2f152373bd3e3fc52dccae4322d2de7fd6467815</id>
<content type='text'>
commit 27c5fb7a84242b66bf1e0b2fe6bf40d19bcc5c04 upstream.

GFP_ATOMIC memory allocation could fail.
In this case, avoid NULL pointer dereference and notify user.

Cc: Kim Phillips &lt;kim.phillips@freescale.com&gt;
Signed-off-by: Horia Geanta &lt;horia.geanta@freescale.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux</title>
<updated>2013-09-07T02:53:35Z</updated>
<author>
<name>Herbert Xu</name>
<email>herbert@gondor.apana.org.au</email>
</author>
<published>2013-09-07T02:53:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=eeca9fad52fc4bfdf42c38bfcf383e932eb3e9d6'/>
<id>urn:sha1:eeca9fad52fc4bfdf42c38bfcf383e932eb3e9d6</id>
<content type='text'>
Merge upstream tree in order to reinstate crct10dif.
</content>
</entry>
<entry>
<title>crypto: nx - fix SHA-2 for chunks bigger than block size</title>
<updated>2013-09-02T10:32:56Z</updated>
<author>
<name>Marcelo Cerri</name>
<email>mhcerri@linux.vnet.ibm.com</email>
</author>
<published>2013-08-29T14:36:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=069fa0453f9dc86fd97dd5b3f5fda4724ed5ff69'/>
<id>urn:sha1:069fa0453f9dc86fd97dd5b3f5fda4724ed5ff69</id>
<content type='text'>
Each call to the co-processor, with exception of the last call, needs to
send data that is multiple of block size. As consequence, any remaining
data is kept in the internal NX context.

This patch fixes a bug in the driver that causes it to save incorrect
data into the context when data is bigger than the block size.

Reviewed-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Signed-off-by: Marcelo Cerri &lt;mhcerri@linux.vnet.ibm.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: nx - fix GCM for zero length messages</title>
<updated>2013-09-02T10:32:55Z</updated>
<author>
<name>Marcelo Cerri</name>
<email>mhcerri@linux.vnet.ibm.com</email>
</author>
<published>2013-08-29T14:36:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dec0ed6c1b2c8c2aa37c04feccaf4784764c95f1'/>
<id>urn:sha1:dec0ed6c1b2c8c2aa37c04feccaf4784764c95f1</id>
<content type='text'>
The NX CGM implementation doesn't support zero length messages and the
current implementation has two flaws:

 - When the input data length is zero, it ignores the associated data.
 - Even when both lengths are zero, it uses the Crypto API to encrypt a
   zeroed block using ctr(aes) and because of this it allocates a new
   transformation and sets the key for this new tfm. Both operations are
   intended to be used only in user context, while the cryptographic
   operations can be called in both user and softirq contexts.

This patch replaces the nested Crypto API use and adds two special
cases:

 - When input data and associated data lengths are zero: it uses NX ECB
   mode to emulate the encryption of a zeroed block using ctr(aes).
 - When input data is zero and associated data is available: it uses NX
   GMAC mode to calculate the associated data MAC.

Reviewed-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Signed-off-by: Marcelo Cerri &lt;mhcerri@linux.vnet.ibm.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: nx - fix XCBC for zero length messages</title>
<updated>2013-09-02T10:32:55Z</updated>
<author>
<name>Marcelo Cerri</name>
<email>mhcerri@linux.vnet.ibm.com</email>
</author>
<published>2013-08-29T14:36:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=41e3173daf4e2d2f2dcc48ae7ffc8d0c4f3ecec9'/>
<id>urn:sha1:41e3173daf4e2d2f2dcc48ae7ffc8d0c4f3ecec9</id>
<content type='text'>
The NX XCBC implementation doesn't support zero length messages and
because of that NX is currently returning a hard-coded hash for zero
length messages. However this approach is incorrect since the hash value
also depends on which key is used.

This patch removes the hard-coded hash and replace it with an
implementation based on the RFC 3566 using ECB.

Reviewed-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Signed-off-by: Marcelo Cerri &lt;mhcerri@linux.vnet.ibm.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: nx - fix limits to sg lists for AES-CCM</title>
<updated>2013-09-02T10:32:54Z</updated>
<author>
<name>Fionnuala Gunter</name>
<email>fin@linux.vnet.ibm.com</email>
</author>
<published>2013-08-29T14:36:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2b188b3b86005ca63eb851a1992f06b9a301f800'/>
<id>urn:sha1:2b188b3b86005ca63eb851a1992f06b9a301f800</id>
<content type='text'>
This patch updates the NX driver to perform several hyper calls when necessary
so that the length limits of scatter/gather lists are respected.

Reviewed-by: Marcelo Cerri &lt;mhcerri@linux.vnet.ibm.com&gt;
Signed-off-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Signed-off-by: Fionnuala Gunter &lt;fin@linux.vnet.ibm.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: nx - fix limits to sg lists for AES-XCBC</title>
<updated>2013-09-02T10:32:54Z</updated>
<author>
<name>Fionnuala Gunter</name>
<email>fin@linux.vnet.ibm.com</email>
</author>
<published>2013-08-29T14:36:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9d6f1a82d3a81d603526980ef705b9ab39f997f3'/>
<id>urn:sha1:9d6f1a82d3a81d603526980ef705b9ab39f997f3</id>
<content type='text'>
This patch updates the NX driver to perform several hyper calls when necessary
so that the length limits of scatter/gather lists are respected.

Reviewed-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Reviewed-by: Marcelo Cerri &lt;mhcerri@linux.vnet.ibm.com&gt;
Signed-off-by: Fionnuala Gunter &lt;fin@linux.vnet.ibm.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
<entry>
<title>crypto: nx - fix limits to sg lists for AES-GCM</title>
<updated>2013-09-02T10:32:54Z</updated>
<author>
<name>Marcelo Cerri</name>
<email>mhcerri@linux.vnet.ibm.com</email>
</author>
<published>2013-08-29T14:36:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=799804348d11763b84213156318bb92cb955bfb5'/>
<id>urn:sha1:799804348d11763b84213156318bb92cb955bfb5</id>
<content type='text'>
This patch updates the nx-aes-gcm implementation to perform several
hyper calls if needed in order to always respect the length limits for
scatter/gather lists.

Two different limits are considered:

 - "ibm,max-sg-len": maximum number of bytes of each scatter/gather
   list.

 - "ibm,max-sync-cop":
    - The total number of bytes that a scatter/gather list can hold.
    - The maximum number of elements that a scatter/gather list can have.

Reviewed-by: Joy Latten &lt;jmlatten@linux.vnet.ibm.com&gt;
Signed-off-by: Marcelo Cerri &lt;mhcerri@linux.vnet.ibm.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
</content>
</entry>
</feed>
