[PATCH] crypto: sm3 - fix undefined shift by >= width of value

2019-01-08 Thread Eric Biggers
From: Eric Biggers sm3_compress() calls rol32() with shift >= 32, which causes undefined behavior. This is easily detected by enabling CONFIG_UBSAN. Explicitly AND with 31 to make the behavior well defined. Fixes: 4f0fc1600edb ("crypto: sm3 - add OSCCA SM3 secure hash") Cc: # v4.15+ Cc: Gilad

[PATCH v2 -next] crypto: brcm - Fix some set-but-not-used warning

2019-01-08 Thread YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning: drivers/crypto/bcm/cipher.c: In function 'handle_ahash_req': drivers/crypto/bcm/cipher.c:720:15: warning: variable 'chunk_start' set but not used [-Wunused-but-set-variable] drivers/crypto/bcm/cipher.c: In function 'spu_rx_callback': drivers/crypto/

Re: [PATCH -next] crypto: brcm - Fix some set-but-not-used warning

2019-01-08 Thread YueHaibing
On 2019/1/9 13:35, Raveendra Padasalagi wrote: > Hi YueHaibing, > > Please add below fixes tag in the commit message, > Fixes: 9d12ba86f818 ("crypto: brcm - Add Broadcom SPU driver") > > Otherwise patch looks good to me. Ok, will send v2, Thanks. > > -Raveendra > > On Fri, Dec 28, 2018 at 9:0

Re: [PATCH -next] crypto: brcm - Fix some set-but-not-used warning

2019-01-08 Thread Raveendra Padasalagi
Hi YueHaibing, Please add below fixes tag in the commit message, Fixes: 9d12ba86f818 ("crypto: brcm - Add Broadcom SPU driver") Otherwise patch looks good to me. -Raveendra On Fri, Dec 28, 2018 at 9:07 AM YueHaibing wrote: > > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/crypto/b

[PATCH AUTOSEL 4.19 17/97] crypto: ecc - regularize scalar for scalar multiplication

2019-01-08 Thread Sasha Levin
From: Vitaly Chikunov [ Upstream commit 3da2c1dfdb802b184eea0653d1e589515b52d74b ] ecc_point_mult is supposed to be used with a regularized scalar, otherwise, it's possible to deduce the position of the top bit of the scalar with timing attack. This is important when the scalar is a private key.

[PATCH AUTOSEL 4.20 020/117] crypto: ecc - regularize scalar for scalar multiplication

2019-01-08 Thread Sasha Levin
From: Vitaly Chikunov [ Upstream commit 3da2c1dfdb802b184eea0653d1e589515b52d74b ] ecc_point_mult is supposed to be used with a regularized scalar, otherwise, it's possible to deduce the position of the top bit of the scalar with timing attack. This is important when the scalar is a private key.

Re: [PATCH v4 1/2] crypto: talitos - reorder code in talitos_edesc_alloc()

2019-01-08 Thread Christophe Leroy
Le 08/01/2019 à 07:56, Christophe Leroy a écrit : This patch moves the mapping of IV after the kmalloc(). This avoids having to unmap in case kmalloc() fails. Signed-off-by: Christophe Leroy Cc: sta...@vger.kernel.org --- new in v4 drivers/crypto/talitos.c | 25 +++--

Re: [PATCH v4 2/2] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2019-01-08 Thread Horia Geanta
On 1/8/2019 8:56 AM, Christophe Leroy wrote: > [2.364486] WARNING: CPU: 0 PID: 60 at ./arch/powerpc/include/asm/io.h:837 > dma_nommu_map_page+0x44/0xd4 > [2.373579] CPU: 0 PID: 60 Comm: cryptomgr_test Tainted: GW > 4.20.0-rc5-00560-g6bfb52e23a00-dirty #531 > [2.384740]

Re: [PATCH v4 1/2] crypto: talitos - reorder code in talitos_edesc_alloc()

2019-01-08 Thread Horia Geanta
On 1/8/2019 8:56 AM, Christophe Leroy wrote: > This patch moves the mapping of IV after the kmalloc(). This > avoids having to unmap in case kmalloc() fails. > > Signed-off-by: Christophe Leroy Reviewed-by: Horia Geantă Since patch 2/2 is Cc-ing stable, this one should do the same. Herbert, cou

Re: [PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2019-01-08 Thread Michael Ellerman
Christophe Leroy writes: > Le 04/01/2019 à 16:24, Horia Geanta a écrit : >> On 1/4/2019 5:17 PM, Horia Geanta wrote: >>> On 12/21/2018 10:07 AM, Christophe Leroy wrote: >>> [snip] IV cannot be on stack when CONFIG_VMAP_STACK is selected because the stack cannot be DMA mapped anymore. >>>

Re: [PATCH 4.9,4.4] crypto: x86/chacha20 - avoid sleeping with preemption disabled

2019-01-08 Thread Ard Biesheuvel
On Tue, 8 Jan 2019 at 00:16, Eric Biggers wrote: > > From: Eric Biggers > > Hi Greg, please consider applying this to 4.9-stable and 4.4-stable. > It's a minimal fix for a bug that was fixed incidentally by a large > refactoring in v4.11. > > >8