Re: [kernel-hardening] Re: Remaining crypto API regressions with CONFIG_VMAP_STACK

2016-12-09 Thread Eric Biggers
On Sat, Dec 10, 2016 at 01:37:12PM +0800, Herbert Xu wrote: > On Fri, Dec 09, 2016 at 09:25:38PM -0800, Andy Lutomirski wrote: > > > > Herbert, how hard would it be to teach the crypto code to use a more > > sensible data structure than scatterlist and to use coccinelle fix > > this stuff for real?

Re: [kernel-hardening] Re: Remaining crypto API regressions with CONFIG_VMAP_STACK

2016-12-09 Thread Eric Biggers
On Sat, Dec 10, 2016 at 01:32:08PM +0800, Herbert Xu wrote: > On Fri, Dec 09, 2016 at 09:25:38PM -0800, Andy Lutomirski wrote: > > > > > The following crypto drivers initialize a scatterlist to point into an > > > ablkcipher_request, which may have been allocated on the stack with > > > SKCIPHER_RE

Crypto Fixes for 4.9

2016-12-09 Thread Herbert Xu
Hi Linus: This push 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 c

Re: Remaining crypto API regressions with CONFIG_VMAP_STACK

2016-12-09 Thread Eric Biggers
On Fri, Dec 09, 2016 at 09:25:38PM -0800, Andy Lutomirski wrote: > > The following crypto drivers initialize a scatterlist to point into an > > ahash_request, which may have been allocated on the stack with > > AHASH_REQUEST_ON_STACK(): > > > > drivers/crypto/bfin_crc.c:351 > > driv

Re: Remaining crypto API regressions with CONFIG_VMAP_STACK

2016-12-09 Thread Herbert Xu
On Fri, Dec 09, 2016 at 09:25:38PM -0800, Andy Lutomirski wrote: > > Herbert, how hard would it be to teach the crypto code to use a more > sensible data structure than scatterlist and to use coccinelle fix > this stuff for real? First of all we already have a sync non-SG hash interface, it's call

Re: Remaining crypto API regressions with CONFIG_VMAP_STACK

2016-12-09 Thread Herbert Xu
On Fri, Dec 09, 2016 at 09:25:38PM -0800, Andy Lutomirski wrote: > > > The following crypto drivers initialize a scatterlist to point into an > > ablkcipher_request, which may have been allocated on the stack with > > SKCIPHER_REQUEST_ON_STACK(): > > > > drivers/crypto/ccp/ccp-crypto-aes-xt

Re: [PATCH 7/7] hwrng: core: Remove two unused include

2016-12-09 Thread kbuild test robot
Hi Corentin, [auto build test ERROR on char-misc/char-misc-testing] [also build test ERROR on v4.9-rc8 next-20161209] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Corentin-Labbe/hwrng-core-do

Re: Remaining crypto API regressions with CONFIG_VMAP_STACK

2016-12-09 Thread Andy Lutomirski
On Fri, Dec 9, 2016 at 3:08 PM, Eric Biggers wrote: > In the 4.9 kernel, virtually-mapped stacks will be supported and enabled by > default on x86_64. This has been exposing a number of problems in which > on-stack buffers are being passed into the crypto API, which to support crypto > accelerato

Re: [PATCH 7/7] hwrng: core: Remove two unused include

2016-12-09 Thread kbuild test robot
Hi Corentin, [auto build test ERROR on char-misc/char-misc-testing] [also build test ERROR on v4.9-rc8 next-20161209] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Corentin-Labbe/hwrng-core-do

Remaining crypto API regressions with CONFIG_VMAP_STACK

2016-12-09 Thread Eric Biggers
In the 4.9 kernel, virtually-mapped stacks will be supported and enabled by default on x86_64. This has been exposing a number of problems in which on-stack buffers are being passed into the crypto API, which to support crypto accelerators operates on 'struct page' rather than on virtual memory.

Re: [PATCH v6 1/2] sparc: fix a building error reported by kbuild

2016-12-09 Thread Sam Ravnborg
Hi Gonglei. On Thu, Dec 08, 2016 at 12:37:08PM +0800, Gonglei wrote: > >> arch/sparc/include/asm/topology_64.h:44:44: > error: implicit declaration of function 'cpu_data' > [-Werror=implicit-function-declaration] > > #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id) >

Re: [PATCH v2 1/3] crypto: brcm: DT documentation for Broadcom SPU driver

2016-12-09 Thread Rob Herring
On Fri, Dec 02, 2016 at 04:34:57PM -0500, Rob Rice wrote: > Device tree documentation for Broadcom Secure Processing Unit > (SPU) crypto driver. > > Signed-off-by: Steve Lin > Signed-off-by: Rob Rice > --- > .../devicetree/bindings/crypto/brcm,spu-crypto.txt | 25 > ++ > 1

Re: [PATCH] linux/types.h: enable endian checks for all sparse builds

2016-12-09 Thread Michael S. Tsirkin
On Fri, Dec 09, 2016 at 03:18:02PM +, Bart Van Assche wrote: > On 12/08/16 22:40, Madhani, Himanshu wrote: > > We’ll take a look and send patches to resolve these warnings. > > Thanks! > > Bart. > Sounds good. I posted what I have so far so that you can start from that. -- MST -- To unsub

[PATCH] siphash: add cryptographically secure hashtable function

2016-12-09 Thread Jason A. Donenfeld
SipHash is a 64-bit keyed hash function that is actually a cryptographically secure PRF, like HMAC. Except SipHash is super fast, and is meant to be used as a hashtable keyed lookup function. SipHash isn't just some new trendy hash function. It's been around for a while, and there really isn't any

Re: [PATCH 7/7] hwrng: core: Remove two unused include

2016-12-09 Thread Corentin Labbe
On Fri, Dec 09, 2016 at 03:21:39PM +0100, Corentin Labbe wrote: > linux/fs.h and linux/sched.h are useless for hw_random/core.c. > This patch remove them. > > Signed-off-by: Corentin Labbe > --- > drivers/char/hw_random/core.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/ch

Re: [PATCH] linux/types.h: enable endian checks for all sparse builds

2016-12-09 Thread Bart Van Assche
On 12/08/16 22:40, Madhani, Himanshu wrote: > We’ll take a look and send patches to resolve these warnings. Thanks! Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.or

[PATCH v2 1/3] crypto: chacha20 - convert generic and x86 versions to skcipher

2016-12-09 Thread Ard Biesheuvel
This converts the ChaCha20 code from a blkcipher to a skcipher, which is now the preferred way to implement symmetric block and stream ciphers. This ports the generic and x86 versions at the same time because the latter reuses routines of the former. Note that the skcipher_walk() API guarantees t

[PATCH v2 3/3] crypto: arm/chacha20 - implement NEON version based on SSE3 code

2016-12-09 Thread Ard Biesheuvel
This is a straight port to ARM/NEON of the x86 SSE3 implementation of the ChaCha20 stream cipher. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig | 6 + arch/arm/crypto/Makefile | 2 + arch/arm/crypto/chacha20-neon-core.S | 524 arch/ar

[PATCH v2 0/3] crypto: arm64/ARM: NEON accelerated ChaCha20 *skcipher*

2016-12-09 Thread Ard Biesheuvel
Another port of existing x86 SSE code to NEON, again both for arm64 and ARM. ChaCha20 is a stream cipher described in RFC 7539, and is intended to be an efficient software implementable 'standby cipher', in case AES cannot be used. This NEON implementation is almost 2x as fast as the generic C co

[PATCH v2 2/3] crypto: arm64/chacha20 - implement NEON version based on SSE3 code

2016-12-09 Thread Ard Biesheuvel
This is a straight port to arm64/NEON of the x86 SSE3 implementation of the ChaCha20 stream cipher. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/Kconfig | 6 + arch/arm64/crypto/Makefile | 3 + arch/arm64/crypto/chacha20-neon-core.S | 450

[PATCH 2/7] hwrng: core: rewrite better comparison to NULL

2016-12-09 Thread Corentin Labbe
This patch fix the checkpatch warning "Comparison to NULL could be written "!ptr" Signed-off-by: Corentin Labbe --- drivers/char/hw_random/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 00cbb81..70

[PATCH 6/7] hwrng: core: remove unused PFX macro

2016-12-09 Thread Corentin Labbe
This patch remove the unused PFX macro. Signed-off-by: Corentin Labbe --- drivers/char/hw_random/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 1e1e385..5c654b5 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers

[PATCH 3/7] hwrng: core: Rewrite the header

2016-12-09 Thread Corentin Labbe
checkpatch have lot of complaint about header. Furthermore, the header have some offtopic/useless information. This patch rewrite a proper header. Signed-off-by: Corentin Labbe --- drivers/char/hw_random/core.c | 38 +- 1 file changed, 9 insertions(+), 29 del

[PATCH 7/7] hwrng: core: Remove two unused include

2016-12-09 Thread Corentin Labbe
linux/fs.h and linux/sched.h are useless for hw_random/core.c. This patch remove them. Signed-off-by: Corentin Labbe --- drivers/char/hw_random/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 5c654b5..85c9ab3 100644

[PATCH 4/7] hwrng: core: Replace asm/uaccess.h by linux/uaccess.h

2016-12-09 Thread Corentin Labbe
This patch fix the checkpatch warning about asm/uaccess.h. In the same time, we sort the headers in alphabetical order. Signed-off-by: Corentin Labbe --- drivers/char/hw_random/core.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/char/hw_random/core

[PATCH 5/7] hwrng: core: Move hwrng miscdev minor number to include/linux/miscdevice.h

2016-12-09 Thread Corentin Labbe
This patch move the define for hwrng's miscdev minor number to include/linux/miscdevice.h. It's better that all minor number are in the same place. Rename it to HWRNG_MINOR (from RNG_MISCDEV_MINOR) in he process since no other miscdev define have MISCDEV in their name. Signed-off-by: Corentin Labb

[PATCH 1/7] hwrng: core: do not use multiple blank lines

2016-12-09 Thread Corentin Labbe
This patch fix the checkpatch warning "Please don't use multiple blank lines" Signed-off-by: Corentin Labbe --- drivers/char/hw_random/core.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index d2d2c89..00cbb81 100644 --- a/

[PATCH] crypto: arm/aes-neonbs - process 8 blocks in parallel if we can

2016-12-09 Thread Ard Biesheuvel
The bit-sliced NEON implementation of AES only performs optimally if it can process 8 blocks of input in parallel. This is due to the nature of bit slicing, where the n-th bit of each byte of AES state of each input block is collected into NEON register 'n', for registers q0 - q7. This implies tha

Re: scatterwalk_map_and_copy incorrect optimization

2016-12-09 Thread Jason A. Donenfeld
Hah, looks like I missed [1] by a couple weeks. Looks like it's been settled then. Is this a stable@ candidate? [1] https://git.zx2c4.com/linux/commit/?id=c8467f7a3620698bf3c22f0e199b550fb611a8ae -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message

scatterwalk_map_and_copy incorrect optimization

2016-12-09 Thread Jason A. Donenfeld
Hi Herbert, The scatterwalk_map_and_copy function copies ordinary buffers to and from scatterlists. These buffers can, of course, be on the stack, and this remains the most popular use of this function -- getting info between stack buffers and DMA regions. It's mostly used for adding or checking M

Re: [PATCH v1 2/2] crypto: mediatek - add DT bindings documentation

2016-12-09 Thread Matthias Brugger
On 08/12/16 10:19, Ryder Lee wrote: Hello, On Mon, 2016-12-05 at 11:18 +0100, Matthias Brugger wrote: On 05/12/16 08:01, Ryder Lee wrote: Add DT bindings documentation for the crypto driver Signed-off-by: Ryder Lee --- .../devicetree/bindings/crypto/mediatek-crypto.txt | 32 +

Re: [PATCH] linux/types.h: enable endian checks for all sparse builds

2016-12-09 Thread Madhani, Himanshu
Hi Mike/Bart, On 12/8/16, 8:17 AM, "virtualization-boun...@lists.linux-foundation.org on behalf of Michael S. Tsirkin" wrote: >On Thu, Dec 08, 2016 at 06:38:11AM +, Bart Van Assche wrote: >> On 12/07/16 21:54, Michael S. Tsirkin wrote: >> > On Thu, Dec 08, 2016 at 05:21:47AM +,