Re: [PATCH] crypto: s5p-sss: remove redundant null check

2020-09-10 Thread Herbert Xu
On Thu, Sep 03, 2020 at 08:37:38AM +, Xu Wang wrote: > Because clk_disable_unprepare already checked NULL clock > parameter, so the additional checks are unnecessary, just remove them. > > Signed-off-by: Xu Wang > --- > drivers/crypto/s5p-sss.c | 6 ++ > 1 file changed, 2 insertions(+),

Re: [PATCH v3 0/7] crypto: mark ecb(arc4) skcipher as obsolete

2020-09-10 Thread Herbert Xu
On Mon, Aug 31, 2020 at 06:16:42PM +0300, Ard Biesheuvel wrote: > RC4 hasn't aged very well, and is a poor fit for the skcipher API so it > would be good if we could get rid of the ecb(arc4) drivers in the kernel > at some point in the future. This prevents new users from creeping in, and > allows

Re: [PATCH v3 0/3] hwrng: add support for Xiphera XIP8001B

2020-09-10 Thread Herbert Xu
On Wed, Sep 02, 2020 at 01:28:14PM +0300, Atte Tommiska wrote: > This patchset introduces a linux driver for Xiphera's XIP8001B IP. > The IP is an FPGA-based TRNG which can be used in various FPGA families. > The IP is in use in multiple customer projects and in Xiphera's own products. > > changes

Re: [PATCH] hwrng: imx-rngc - add quality to use it as kernel entropy pool

2020-09-10 Thread Herbert Xu
On Mon, Aug 31, 2020 at 04:00:42PM +0200, Marco Felsch wrote: > The RM describes the RNGB as follow: > 8< > The RNGB uses the True Random Number Generator (TRNG) and a > Pseudo-Random Number Generator (PRNG) to achieve a true randomnes

Re: [PATCH v2] crypto: qat - check cipher length for aead AES-CBC-HMAC-SHA

2020-09-10 Thread Herbert Xu
On Mon, Aug 31, 2020 at 11:59:59AM +0100, Giovanni Cabiddu wrote: > From: Dominik Przychodni > > Return -EINVAL for authenc(hmac(sha1),cbc(aes)), > authenc(hmac(sha256),cbc(aes)) and authenc(hmac(sha512),cbc(aes)) > if the cipher length is not multiple of the AES block. > This is to prevent an un

Re: [PATCH v1] crypto: caam - use traditional error check pattern

2020-09-10 Thread Herbert Xu
Andy Shevchenko wrote: > Use traditional error check pattern >ret = ...; >if (ret) >return ret; >... > instead of checking error code to be 0. > > Signed-off-by: Andy Shevchenko > --- > drivers/crypto/caam/ctrl.c | 7 +++ > 1 file changed, 3 insertions(

Re: [PATCH] crypto/x86: Use XORL r32,32 in poly1305-x86_64-cryptogams.pl

2020-09-10 Thread Herbert Xu
On Thu, Aug 27, 2020 at 07:38:31PM +0200, Uros Bizjak wrote: > x86_64 zero extends 32bit operations, so for 64bit operands, > XORL r32,r32 is functionally equal to XORQ r64,r64, but avoids > a REX prefix byte when legacy registers are used. > > Signed-off-by: Uros Bizjak > Cc: Herbert Xu > Cc: "

Re: [PATCH] crypto/x86: Use XORL r32,32 in curve25519-x86_64.c

2020-09-10 Thread Herbert Xu
On Thu, Aug 27, 2020 at 07:30:58PM +0200, Uros Bizjak wrote: > x86_64 zero extends 32bit operations, so for 64bit operands, > XORL r32,r32 is functionally equal to XORL r64,r64, but avoids > a REX prefix byte when legacy registers are used. > > Signed-off-by: Uros Bizjak > Cc: Herbert Xu > Cc: "

Re: [PATCH 2/2] crypto: sa2ul: fix compiler warning produced by clang

2020-09-10 Thread Herbert Xu
On Tue, Aug 25, 2020 at 04:31:06PM +0300, Tero Kristo wrote: > Clang detects a warning for an assignment that doesn't really do > anything. Fix this by removing the offending piece of code. > > Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver") > Reported-by: Nathan Chancellor > Signed-off

[PATCH] crypto: n2 - Fix sparse endianness warning

2020-09-10 Thread Herbert Xu
This patch fixes sparse endianness warnings by changing the type of hash_init to u8 from u32. There should be no difference in the generated code. Signed-off-by: Herbert Xu diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c index f137f22da8fb..3642bf83d809 100644 --- a/drivers/cry

Re: [PATCH v6 09/18] crypto: sun8i-ce: split into prepare/run/unprepare

2020-09-10 Thread Herbert Xu
On Fri, Sep 04, 2020 at 11:09:54AM +, Corentin Labbe wrote: > > +static int sun8i_ce_cipher_unprepare(struct crypto_engine *engine, void > *async_req) > +{ > + struct skcipher_request *areq = container_of(async_req, struct > skcipher_request, base); > + struct crypto_skcipher *tfm = c

Re: [PATCH v3 3/3] hwrng: xiphera-trng: add support for XIP8001B hwrng

2020-09-10 Thread Herbert Xu
On Wed, Sep 02, 2020 at 01:28:17PM +0300, Atte Tommiska wrote: > Xiphera XIP8001B is an FPGA-based True Random Number Generator > Intellectual Property (IP) Core which can be instantiated in > multiple FPGA families. This driver adds Linux support for it through > the hwrng interface. > > Signed-o

Re: [PATCH v3 7/7] crypto: arc4 - mark ecb(arc4) skcipher as obsolete

2020-09-10 Thread Herbert Xu
On Mon, Aug 31, 2020 at 06:16:49PM +0300, Ard Biesheuvel wrote: > > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include This needs kernel.h too for the pr_warn_ratelimited. I'll add it when I apply the series. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au

Re: [PATCH] crypto: stm32/crc32 - Avoid lock if hardware is already used

2020-09-10 Thread Herbert Xu
On Fri, Sep 04, 2020 at 01:25:27PM +0200, Nicolas Toromanoff wrote: > If STM32 CRC device is already in use, calculate CRC by software. > > This will release CPU constraint for a concurrent access to the > hardware, and avoid masking irqs during the whole block processing. > > Fixes: 7795c0baf5ac

Re: [PATCH v6 0/8] crpyto: introduce OSCCA certificate and SM2 asymmetric algorithm

2020-09-10 Thread Herbert Xu
On Thu, Sep 03, 2020 at 09:12:34PM +0800, Tianjia Zhang wrote: > > --- > v6 changes: > 1. remove mpi_sub_ui function from mpi library. > 2. rebase on mainline. This series is still missing acks for patches 6-8. Without them it cannot proceed. Thanks, -- Email: Herbert Xu Home Page: http://

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Joe Perches
On Thu, 2020-09-10 at 15:21 +0100, Robin Murphy wrote: > On 2020-09-09 21:06, Joe Perches wrote: > > fallthrough to a separate case/default label break; isn't very readable. > > > > Convert pseudo-keyword fallthrough; statements to a simple break; when > > the next label is case or default and the

Re: [v2 PATCH] crypto: sun4i-ss - Fix sparse endianness markers

2020-09-10 Thread Herbert Xu
On Thu, Sep 10, 2020 at 02:22:48PM +0200, Corentin Labbe wrote: > > I get some md5 error on both A20+BE: > alg: ahash: md5 test failed (wrong result) on test vector \"random: psize=129 > ksize=0\", cfg=\"random: inplace use_finup nosimd > src_divs=[85.99%@+3999, 5.85%@+30, 0.96%@+25, > 5.9%@+226

Re: [PATCH v3] cypto: mediatek - fix leaks in mtk_desc_ring_alloc

2020-09-10 Thread Herbert Xu
On Fri, Sep 11, 2020 at 09:36:19AM +0800, Xiaoliang Pang wrote: > > diff --git a/drivers/crypto/mediatek/mtk-platform.c > b/drivers/crypto/mediatek/mtk-platform.c > index 7e3ad085b5bd..ebb3bdef0dbe 100644 > --- a/drivers/crypto/mediatek/mtk-platform.c > +++ b/drivers/crypto/mediatek/mtk-platform.c

[PATCH v3] cypto: mediatek - fix leaks in mtk_desc_ring_alloc

2020-09-10 Thread Xiaoliang Pang
In the init loop, if an error occurs in function 'dma_alloc_coherent', then goto the err_cleanup section, in the cleanup loop, after run i--, the struct mtk_ring rising[i] will not be released, causing a memory leak Signed-off-by: Xiaoliang Pang --- drivers/crypto/mediatek/mtk-platform.c | 4 ++-

Re: [PATCH 0/5] crypto: hisilicon - update ACC module parameter

2020-09-10 Thread liulongfang
On 2020/9/10 20:56, Longfang Liu Wrote: > In order to pass kernel crypto test, the ACC module parameter > pf_q_num needs to be set to an integer greater than 1, > and then fixed two bugs. > > Longfang Liu (5): > crypto: hisilicon - update mininum queue > crypto: hisilicon - update HPRE module

[PATCH 0/5] crypto: hisilicon - update ACC module parameter

2020-09-10 Thread Longfang Liu
In order to pass kernel crypto test, the ACC module parameter pf_q_num needs to be set to an integer greater than 1, and then fixed two bugs. Longfang Liu (5): crypto: hisilicon - update mininum queue crypto: hisilicon - update HPRE module parameter description crypto: hisilicon - update SEC

[PATCH 5/5] crypto: hisilicon - fixed memory allocation error

2020-09-10 Thread Longfang Liu
1. Fix the bug of 'mac' memory leak as allocating 'pbuf' failing. 2. Fix the bug of 'qps' leak as allocating 'qp_ctx' failing. Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/sec2/sec_crypto.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/

[PATCH 0/5] crypto: hisilicon - update ACC module parameter

2020-09-10 Thread Longfang Liu
In order to pass kernel crypto test, the ACC module parameter pf_q_num needs to be set to an integer greater than 1, and then fixed two bugs. Longfang Liu (5): crypto: hisilicon - update mininum queue crypto: hisilicon - update HPRE module parameter description crypto: hisilicon - update SEC

[PATCH 2/5] crypto: hisilicon - update HPRE module parameter description

2020-09-10 Thread Longfang Liu
In order to pass kernel CRYPTO test, HPRE module parameter 'pf_q_num' needs to be set as greater than 1. Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/hpre/hpre_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/driv

[PATCH 5/5] crypto: hisilicon - fixed memory allocation error

2020-09-10 Thread Longfang Liu
1. Fix the bug of 'mac' memory leak as allocating 'pbuf' failing. 2. Fix the bug of 'qps' leak as allocating 'qp_ctx' failing. Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/sec2/sec_crypto.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/

KMSAN: uninit-value in aes_encrypt (4)

2020-09-10 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:3b3ea602 x86: add failure injection to get/put/clear_user git tree: https://github.com/google/kmsan.git master console output: https://syzkaller.appspot.com/x/log.txt?x=1030dda590 kernel config: https://syzkaller.appspot.com/x

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Robin Murphy
On 2020-09-09 21:06, Joe Perches wrote: fallthrough to a separate case/default label break; isn't very readable. Convert pseudo-keyword fallthrough; statements to a simple break; when the next label is case or default and the only statement in the next label block is break; Found using: $ grep

[PATCH v2 2/4] crypto: caam - Simplify with dev_err_probe()

2020-09-10 Thread Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Iuliana Prodan --- Changes since v1: 1. Add Reviewed-by --- drivers/crypto/caam/caamalg_qi2.c | 3 +-- 1 file changed,

[PATCH v2 3/4] crypto: stm32-hash - Simplify with dev_err_probe()

2020-09-10 Thread Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. None --- drivers/crypto/stm32/stm32-hash.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-

[PATCH v2 1/4] crypto: caam - Fix kerneldoc

2020-09-10 Thread Krzysztof Kozlowski
Fix kerneldoc warnings like: drivers/crypto/caam/caamalg_qi2.c:73: warning: cannot understand function prototype: 'struct caam_ctx' drivers/crypto/caam/caamalg_qi2.c:2962: warning: cannot understand function prototype: 'struct caam_hash_ctx' drivers/crypto/caam/ctrl.c:449: warning: Functio

[PATCH v2 4/4] crypto: allwinner/sun8i - Simplify with dev_err_probe()

2020-09-10 Thread Krzysztof Kozlowski
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. None --- drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 9 +++-- drivers/crypto/allwinner/sun8i-ss

[PATCH 2/5] crypto: hisilicon - update HPRE module parameter description

2020-09-10 Thread Longfang Liu
In order to pass kernel CRYPTO test, HPRE module parameter 'pf_q_num' needs to be set as greater than 1. Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/hpre/hpre_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/driv

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Nicolas.Ferre
Joe, Please drop this chunk: it's a successive controller version number which are all backward compatible with "fallthrough" on each case so removing from this last one makes it inconsistent. In sort: NACK for atmel-mci. Best regards, Nicolas On 09/09/2020 at 22:06, Joe Perches wrote: >

Re: [v2 PATCH] crypto: sun4i-ss - Fix sparse endianness markers

2020-09-10 Thread Corentin Labbe
On Tue, Sep 08, 2020 at 03:00:36PM +1000, Herbert Xu wrote: > On Mon, Sep 07, 2020 at 06:00:29PM +0200, Corentin Labbe wrote: > > > > The put_unaligned should be _le32. > > > > This fix the modprobe tcrypt fail. > > Thanks. Yes the original code was correct. > > ---8<--- > This patch also fixes

[PATCH 1/3] crypto: hisilicon/hpre - delete an useless member

2020-09-10 Thread Meng Yu
Remove unused member 'debug_root' in 'struct hpre_debug'. Fixes: 848974151618("crypto: hisilicon - Add debugfs for HPRE") Fixes: dadbe4c11753("crypto: hisilicon/hpre - update debugfs ...") Signed-off-by: Meng Yu --- drivers/crypto/hisilicon/hpre/hpre.h | 1 - 1 file changed, 1 deletion(-) diff

[PATCH 3/3] crypto: hisilicon/hpre - fix a bug in dh algorithm

2020-09-10 Thread Meng Yu
Using 'g' equals 5 in dh algorithm may cause an error like this: arm-smmu-v3 arm-smmu-v3.1.auto: event 0x10 received: dh: Party A: generate public key test failed. err -22 11375.065672] dh alg: dh: test failed on vector 1, err=-22 arm-smmu-v3 arm-smmu-v3.1.auto: 0x7910 arm-smmu-v3 arm

[PATCH 2/3] crypto: hisilicon/hpre - adjust some coding style

2020-09-10 Thread Meng Yu
Adjust some coding style to make code aligned. Signed-off-by: Meng Yu --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c index

[PATCH 0/3] crypto: hisilicon/hpre - misc clean up and fixes

2020-09-10 Thread Meng Yu
Adjust some tiny coding problems and fix a bug of DH algorithm. Meng Yu (3): crypto: hisilicon/hpre - delete an useless member crypto: hisilicon/hpre - adjust some coding style crypto: hisilicon/hpre - fix a bug in dh algorithm drivers/crypto/hisilicon/hpre/hpre.h| 1 - drivers/cr

[PATCH 4/5] crypto: hisilicon - update ZIP module parameter description

2020-09-10 Thread Longfang Liu
In order to pass kernel CRYPTO test, ZIP module parameter 'pf_q_num' needs to be set as greater than 1. Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/zip/zip_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/c

[PATCH 3/5] crypto: hisilicon - update SEC module parameter description

2020-09-10 Thread Longfang Liu
In order to pass kernel CRYPTO test, SEC module parameter 'pf_q_num' needs to be set as greater than 1. Signed-off-by: Longfang Liu --- drivers/crypto/hisilicon/sec2/sec_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers

[PATCH 1/5] crypto: hisilicon - update mininum queue

2020-09-10 Thread Longfang Liu
At present, as HPRE/SEC/ZIP modules' parameter 'pf_q_num' is 1, kernel CRYPTO test will fail on the algorithms from the modules, since 'QP' hardware resources are not enough for CRYPTO TFM. To fix this, the minimum value of 'pf_q_num' should be 2. Signed-off-by: Longfang Liu --- drivers/crypto/h

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Matthias Brugger
On 09/09/2020 22:06, Joe Perches wrote: diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net/wireless/mediatek/mt7601u/dma.c index 09f931d4598c..778be26d329f 100644 --- a/drivers/net/wireless/mediatek/mt7601u/dma.c +++ b/drivers/net/wireless/mediatek/mt7601u/dma.c @@ -193,11

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Ilya Dryomov
On Wed, Sep 9, 2020 at 10:10 PM Joe Perches wrote: > > fallthrough to a separate case/default label break; isn't very readable. > > Convert pseudo-keyword fallthrough; statements to a simple break; when > the next label is case or default and the only statement in the next > label block is break;

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Steffen Maier
On 9/9/20 10:06 PM, Joe Perches wrote: fallthrough to a separate case/default label break; isn't very readable. Convert pseudo-keyword fallthrough; statements to a simple break; when the next label is case or default and the only statement in the next label block is break; Found using: $ grep-

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Felipe Balbi
Hi, Joe Perches writes: > drivers/usb/dwc3/core.c | 2 +- > drivers/usb/gadget/legacy/inode.c | 2 +- > drivers/usb/gadget/udc/pxa25x_udc.c | 4 ++-- > drivers/usb/phy/phy-fsl-usb.c |