Re: [cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x'

2018-01-12 Thread Segher Boessenkool
On Fri, Jan 12, 2018 at 10:45:31PM +0100, Arnd Bergmann wrote: > > I guess you could enable the _x routines whenever you use ubsan? Ubsan > > will cause much bigger code growth than the handful of insns in those > > routines? > > Right, that could work, too. My patch that Herbert merged

Re: [cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x'

2018-01-12 Thread Arnd Bergmann
On Fri, Jan 12, 2018 at 10:41 PM, Segher Boessenkool wrote: > On Fri, Jan 12, 2018 at 10:29:01PM +0100, Arnd Bergmann wrote: >> On Fri, Jan 12, 2018 at 9:41 PM, Segher Boessenkool >> wrote: >> > On Fri, Jan 12, 2018 at 08:43:21PM +0100,

Re: [cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x'

2018-01-12 Thread Segher Boessenkool
On Fri, Jan 12, 2018 at 10:29:01PM +0100, Arnd Bergmann wrote: > On Fri, Jan 12, 2018 at 9:41 PM, Segher Boessenkool > wrote: > > On Fri, Jan 12, 2018 at 08:43:21PM +0100, Arnd Bergmann wrote: > >> On Fri, Jan 12, 2018 at 5:39 PM, Segher Boessenkool > > >> We could

Re: [cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x'

2018-01-12 Thread Arnd Bergmann
On Fri, Jan 12, 2018 at 9:41 PM, Segher Boessenkool wrote: > On Fri, Jan 12, 2018 at 08:43:21PM +0100, Arnd Bergmann wrote: >> On Fri, Jan 12, 2018 at 5:39 PM, Segher Boessenkool >> We could theoretically work around it by turning that into >> "#if

Re: [cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x'

2018-01-12 Thread Segher Boessenkool
On Fri, Jan 12, 2018 at 08:43:21PM +0100, Arnd Bergmann wrote: > On Fri, Jan 12, 2018 at 5:39 PM, Segher Boessenkool > wrote: > > >> or why the aes_generic implementation needs this on > >> powerpc when built with 'gcc -Os'. FWIW, the -Os change was needed > >> to

Re: [cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x'

2018-01-12 Thread Arnd Bergmann
On Fri, Jan 12, 2018 at 5:39 PM, Segher Boessenkool wrote: >> or why the aes_generic implementation needs this on >> powerpc when built with 'gcc -Os'. FWIW, the -Os change was needed >> to work around a possible kernel stack overflow that can happen with >> gcc-7.2,

Re: [PATCH v2] crypto: testmgr: change `guard` to unsigned char

2018-01-12 Thread Joey Pabalinas
On Fri, Jan 12, 2018 at 11:23:28PM +1100, Herbert Xu wrote: > > Patch applied. Thanks. No problem, cheers. -- Joey Pabalinas signature.asc Description: PGP signature

Re: [cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x'

2018-01-12 Thread Segher Boessenkool
Hi! On Fri, Jan 12, 2018 at 03:55:47PM +0100, Arnd Bergmann wrote: > >crypto/aes_generic.o: In function `crypto_aes_set_key': > >>> aes_generic.c:(.text+0x4e0): undefined reference to `_restgpr_31_x' > > adding linuxpcc-dev to Cc, maybe someone knows a way out of this. > It appears related

[PATCH][next] hwrng: exynos: check for -ve error return from readl_poll_timeout

2018-01-12 Thread Colin King
From: Colin Ian King Currently, the return from readl_poll_timeout is being assigned to a u32 and this is being checked for a -ve return which is always false since a u32 cannot be less than zero. Fix this by changing val to an int so that error returns can be

[PATCH][next] staging: ccree: fix memory leaks in cc_ivgen_init

2018-01-12 Thread Colin King
From: Colin Ian King The current error exit path in function cc_ivgen_init via label 'out' free's resources from the drvdata->ivgen_handle context. However, drvdata->ivgen_handle has not been assigned to the context ivgen_ctx at this point, so the resources are not

Re: [PATCH 0/5] sha3 fixes and new implementation for arm64

2018-01-12 Thread Ard Biesheuvel
On 12 January 2018 at 13:15, Ard Biesheuvel wrote: > Add an implementation of SHA3 to arm64 using the new special instructions (#4) > > In preparation of that, fix a bug in the SHA3 and refactor it a bit so it > can serve as a fallback for the other code. Also, add some

Re: [cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x'

2018-01-12 Thread Arnd Bergmann
On Fri, Jan 12, 2018 at 3:11 PM, kbuild test robot wrote: > tree: > https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git > master > head: b40fa82cd6138350f723aa47b37e3e3e80906b40 > commit: 148b974deea927f5dbb6c468af2707b488bfa2de [130/134]

[cryptodev:master 130/134] aes_generic.c:undefined reference to `_restgpr_31_x'

2018-01-12 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: b40fa82cd6138350f723aa47b37e3e3e80906b40 commit: 148b974deea927f5dbb6c468af2707b488bfa2de [130/134] crypto: aes-generic - build with -Os on gcc-7+ config: powerpc-linkstation_defconfig (attached as

[RFC] AF_ALG AIO and IV

2018-01-12 Thread Stephan Mueller
Hi, The kernel crypto API requires the caller to set an IV in the request data structure. That request data structure shall define one particular cipher operation. During the cipher operation, the IV is read by the cipher implementation and eventually the potentially updated IV (e.g. in case

[PATCH 0/5] sha3 fixes and new implementation for arm64

2018-01-12 Thread Ard Biesheuvel
Add an implementation of SHA3 to arm64 using the new special instructions (#4) In preparation of that, fix a bug in the SHA3 and refactor it a bit so it can serve as a fallback for the other code. Also, add some new test vectors to get better test coverage. Ard Biesheuvel (5): crypto/generic:

[PATCH 3/5] crypto/generic: sha3 - export init/update/final routines

2018-01-12 Thread Ard Biesheuvel
To allow accelerated implementations to fall back to the generic routines, e.g., in contexts where a SIMD based implementation is not allowed to run, expose the generic SHA3 init/update/final routines to other modules. Signed-off-by: Ard Biesheuvel ---

[PATCH 1/5] crypto/generic: sha3 - fixes for alignment and big endian operation

2018-01-12 Thread Ard Biesheuvel
Ensure that the input is byte swabbed before injecting it into the SHA3 transform. Use the get_unaligned() accessor for this so that we don't perform unaligned access inadvertently on architectures that do not support that. Signed-off-by: Ard Biesheuvel ---

[PATCH 2/5] crypto/generic: sha3 - simplify code

2018-01-12 Thread Ard Biesheuvel
In preparation of exposing the generic SHA3 implementation to other versions as a fallback, simplify the code, and remove an inconsistency in the output handling (endian swabbing rsizw words of state before writing the output does not make sense) Signed-off-by: Ard Biesheuvel

[PATCH 4/5] crypto/arm64: sha3 - new implementation based on special instructions

2018-01-12 Thread Ard Biesheuvel
Implement the various flavours of SHA3 using the new optional EOR3/RAX1/XAR/BCAX instructions introduced by ARMv8.2. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/Kconfig| 6 + arch/arm64/crypto/Makefile | 3 + arch/arm64/crypto/sha3-ce-core.S

[PATCH 5/5] crypto/testmgr: sha3 - add new testcases

2018-01-12 Thread Ard Biesheuvel
All current SHA3 test cases are smaller than the SHA3 block size, which means not all code paths are being exercised. So add a new test case to each variant, and make one of the existing test cases chunked. Signed-off-by: Ard Biesheuvel --- crypto/testmgr.h | 550

Re: [PATCH 00/17] crypto: inside-secure - various improvements

2018-01-12 Thread Antoine Tenart
Hi Herbert, On Fri, Dec 22, 2017 at 03:28:38PM +0100, Antoine Tenart wrote: > On Fri, Dec 22, 2017 at 08:11:54PM +1100, Herbert Xu wrote: > > > > Patches 1-16 applied. If patch 17 needs to go through the crypto > > tree please let me know. > > Thanks! Yes patch 17 should got through the crypto

Re: [PATCH] crypto: chacha20 - use rol32() macro from bitops.h

2018-01-12 Thread Herbert Xu
On Sun, Dec 31, 2017 at 06:02:45PM -0600, Eric Biggers wrote: > From: Eric Biggers > > For chacha20_block(), use the existing 32-bit left-rotate function > instead of defining one ourselves. > > Signed-off-by: Eric Biggers Patch applied. Thanks. --

Re: [PATCH v4] crypto: AF_ALG - whitelist mask and type

2018-01-12 Thread Herbert Xu
On Tue, Jan 02, 2018 at 08:55:25AM +0100, Stephan Müller wrote: > Hi, > > sorry, I forgot the right tags. > > ---8<--- > > The user space interface allows specifying the type and mask field used > to allocate the cipher. Only a subset of the possible flags are intended > for user space.

Re: [PATCH] [v2] crypto: aes-generic - build with -Os on gcc-7+

2018-01-12 Thread Herbert Xu
On Wed, Jan 03, 2018 at 11:39:27PM +0100, Arnd Bergmann wrote: > While testing other changes, I discovered that gcc-7.2.1 produces badly > optimized code for aes_encrypt/aes_decrypt. This is especially true when > CONFIG_UBSAN_SANITIZE_ALL is enabled, where it leads to extremely > large stack

Re: [PATCH] crypto: clear htmldocs build warnings for crypto/hash

2018-01-12 Thread Herbert Xu
On Sun, Jan 07, 2018 at 10:01:43AM +1100, Tobin C. Harding wrote: > SPHINX build emits multiple warnings of kind: > > warning: duplicate section name 'Note' > > (when building kernel via make target 'htmldocs') > > This is caused by repeated use of comments of form: > > * Note:

Re: [PATCH v2 0/3] crypto: salsa20 - cleanup and convert to skcipher API

2018-01-12 Thread Herbert Xu
On Fri, Jan 05, 2018 at 11:09:56AM -0800, Eric Biggers wrote: > From: Eric Biggers > > This series converts the Salsa20 implementations over to the skcipher > API, in the process fixing a couple bugs and making them be more similar > to the ChaCha20 implementations, rather

Re: [PATCH] crypto: tcrypt - free xoutbuf instead of axbuf

2018-01-12 Thread Herbert Xu
On Tue, Jan 02, 2018 at 03:43:04PM +, Colin King wrote: > From: Colin Ian King > > There seems to be a cut-n-paste bug with the name of the buffer being > free'd, xoutbuf should be used instead of axbuf. > > Detected by CoverityScan, CID#1463420 ("Copy-paste

Re: [PATCH] crypto: Use zeroing memory allocator instead of allocator/memset

2018-01-12 Thread Herbert Xu
On Sun, Dec 31, 2017 at 05:54:23PM +0530, Himanshu Jha wrote: > Use dma_zalloc_coherent for allocating zeroed > memory and remove unnecessary memset function. > > Done using Coccinelle. > Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci > 0-day tested with no failures. > >

Re: [RFC PATCH 0/9] crypto: prevent unkeyed use of keyed algorithms

2018-01-12 Thread Herbert Xu
On Wed, Jan 03, 2018 at 11:16:21AM -0800, Eric Biggers wrote: > From: Eric Biggers > > This series updates the crypto API to consistently prevent using keyed > algorithms without setting the key. Currently this is prevented for > AF_ALG but not for other crypto API users,

Re: [PATCH v2] crypto: testmgr: change `guard` to unsigned char

2018-01-12 Thread Herbert Xu
On Mon, Jan 01, 2018 at 10:40:14AM -1000, Joey Pabalinas wrote: > When char is signed, storing the values 0xba (186) and 0xad (173) in the > `guard` array produces signed overflow. Change the type of `guard` to > static unsigned char to correct undefined behavior and reduce function > stack usage.

Re: [PATCH][crypto-next] crypto: tcrypt: fix spelling mistake: "bufufer"-> "buffer"

2018-01-12 Thread Herbert Xu
On Tue, Jan 02, 2018 at 09:21:06AM +, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistakes in pr_err error message text. > > Signed-off-by: Colin Ian King Patch applied. Thanks. -- Email: Herbert Xu

Re: [PATCH 1/2] crypto: Implement a generic crypto statistics

2018-01-12 Thread Stephan Mueller
Am Freitag, 12. Januar 2018, 10:07:30 CET schrieb LABBE Corentin: Hi LABBE, > > > > diff --git a/include/uapi/linux/cryptouser.h > > > b/include/uapi/linux/cryptouser.h index 19bf0ca6d635..15e51ccb3679 > > > 100644 > > > --- a/include/uapi/linux/cryptouser.h > > > +++

Re: [PATCH 1/2] crypto: Implement a generic crypto statistics

2018-01-12 Thread LABBE Corentin
On Fri, Jan 12, 2018 at 07:49:43AM +0100, Stephan Mueller wrote: > Am Donnerstag, 11. Januar 2018, 20:56:56 CET schrieb Corentin Labbe: > > Hi Corentin, > > > This patch implement a generic way to get statistics about all crypto > > usages. > > > > Signed-off-by: Corentin Labbe