Re: [PATCH] crypto: hisilicon/qm - delete redundant code

2021-04-02 Thread Herbert Xu
On Fri, Mar 26, 2021 at 09:14:32AM +0800, Kai Ye wrote: > The memory not needed to clear that will be freed. and the memset is useless > after the dma is freed. I don't doubt that this memory probably doesn't need to be zeroed since all it contains is a bunch of pointers instead of actual data. B

Re: [PATCH 0/3] crypto: replace memset by memzero_explicit

2021-04-02 Thread Herbert Xu
On Fri, Mar 26, 2021 at 09:20:45AM +0800, Kai Ye wrote: > use memzero_explicit instead of memset to clear sensitive data, > such as buffer or key. Does this fix a real issue? If not then it's just unnecessary churn. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/

Re: [PATCH] crypto: hisilicon/hpre - rsa key should not be empty

2021-04-02 Thread Herbert Xu
On Fri, Mar 26, 2021 at 02:13:32PM +0800, Meng Yu wrote: > We should ensure key is not empty before we set key. > > Signed-off-by: Meng Yu > --- > drivers/crypto/hisilicon/hpre/hpre_crypto.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto

Re: [PATCH] crypto: hisilicon/hpre - delete redundant log

2021-04-02 Thread Herbert Xu
On Sat, Mar 27, 2021 at 04:32:26PM +0800, Hui Tang wrote: > 'hpre_cfg_by_dsm' has checked and printed error path, so it is not > necessary at all. > > Signed-off-by: Hui Tang > --- > drivers/crypto/hisilicon/hpre/hpre_main.c | 5 + > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff -

Re: [PATCH] crypto: hisilicon/hpre - delete redundant log

2021-04-02 Thread tanghui20
On 2021/4/2 15:19, Herbert Xu wrote: On Sat, Mar 27, 2021 at 04:32:26PM +0800, Hui Tang wrote: 'hpre_cfg_by_dsm' has checked and printed error path, so it is not necessary at all. Signed-off-by: Hui Tang --- drivers/crypto/hisilicon/hpre/hpre_main.c | 5 + 1 file changed, 1 insertion(+

Re: [PATCH] crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS

2021-04-02 Thread Herbert Xu
Eric Biggers wrote: > From: Eric Biggers > > crypto_stats_get() is a no-op when the kernel is compiled without > CONFIG_CRYPTO_STATS, so pairing it with crypto_alg_put() unconditionally > (as crypto_rng_reset() does) is wrong. > > Fix this by moving the call to crypto_stats_get() to just before

Re: [PATCH RESEND] random: initialize ChaCha20 constants with correct endianness

2021-04-02 Thread Herbert Xu
On Sun, Mar 21, 2021 at 10:13:47PM -0700, Eric Biggers wrote: > From: Eric Biggers > > On big endian CPUs, the ChaCha20-based CRNG is using the wrong > endianness for the ChaCha20 constants. > > This doesn't matter cryptographically, but technically it means it's not > ChaCha20 anymore. Fix it

Re: [PATCH RESEND] random: remove dead code left over from blocking pool

2021-04-02 Thread Herbert Xu
Eric Biggers wrote: > From: Eric Biggers > > Remove some dead code that was left over following commit 90ea1c6436d2 > ("random: remove the blocking pool"). > > Cc: linux-crypto@vger.kernel.org > Cc: Andy Lutomirski > Cc: Jann Horn > Cc: Theodore Ts'o > Reviewed-by: Andy Lutomirski > Acked-b

Re: [PATCH] hwrng: omap - Use of_device_get_match_data() helper

2021-04-02 Thread Herbert Xu
On Mon, Mar 22, 2021 at 02:51:51PM +0800, Tian Tao wrote: > Use the of_device_get_match_data() helper instead of open coding. > > Signed-off-by: Tian Tao > --- > drivers/char/hw_random/omap-rng.c | 11 --- > 1 file changed, 4 insertions(+), 7 deletions(-) Patch applied. Thanks. -- Ema

Re: [PATCH] crypto: qat - fix error path in adf_isr_resource_alloc()

2021-04-02 Thread Herbert Xu
On Thu, Mar 25, 2021 at 08:34:18AM +, Giovanni Cabiddu wrote: > The function adf_isr_resource_alloc() is not unwinding correctly in case > of error. > This patch fixes the error paths and propagate the errors to the caller. > > Fixes: 7afa232e76ce ("crypto: qat - Intel(R) QAT DH895xcc accelera

Re: [PATCH] crypto: hisilicon - use the correct HiSilicon copyright

2021-04-02 Thread Herbert Xu
On Fri, Mar 26, 2021 at 04:42:39PM +0800, Hao Fang wrote: > s/Hisilicon/HiSilicon/g, > according to https://www.hisilicon.com/en/terms-of-use. > > Signed-off-by: Hao Fang > --- > drivers/crypto/hisilicon/sec/sec_algs.c | 2 +- > drivers/crypto/hisilicon/sec/sec_drv.c | 6 +++--- > drivers/crypt

Re: [PATCH] crypto: keywrap: Remove else after break statement

2021-04-02 Thread Herbert Xu
On Fri, Mar 26, 2021 at 11:13:59AM -0700, Milan Djurovic wrote: > Remove the else because the if statement has a break statement. Fix the > checkpatch.pl warning. > > Signed-off-by: Milan Djurovic > --- > crypto/keywrap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Patch applied

Re: [PATCH] crypto: fcrypt: Remove 'do while(0)' loop for single statement macro

2021-04-02 Thread Herbert Xu
On Fri, Mar 26, 2021 at 11:35:11AM -0700, Milan Djurovic wrote: > Remove the 'do while(0)' loop in the macro, as it is not needed for single > statement macros. Condense into one line. > > Signed-off-by: Milan Djurovic > --- > crypto/fcrypt.c | 5 + > 1 file changed, 1 insertion(+), 4 deleti

Re: [PATCH v2 0/4] crypto: hisilicon/zip - support new 'sqe' type in Kunpeng930

2021-04-02 Thread Herbert Xu
On Sat, Mar 27, 2021 at 03:28:44PM +0800, Yang Shen wrote: > In Kunpeng930, some field meanings in 'sqe' are changed, so driver need to > distinguish the type on different platform. > > To avoid checking the platform everytime when driver fills the 'sqe', add a > struct 'hisi_zip_sqe_ops' to descr

Re: [PATCH] crypto: poly1305: fix poly1305_core_setkey() declaration

2021-04-02 Thread Herbert Xu
On Mon, Mar 22, 2021 at 06:05:15PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > gcc-11 points out a mismatch between the declaration and the definition > of poly1305_core_setkey(): > > lib/crypto/poly1305-donna32.c:13:67: error: argument 2 of type ‘const u8[16]’ > {aka ‘const unsigned

Re: [PATCH] crypto: hisilicon/hpre - fix PASID setting on kunpeng 920

2021-04-02 Thread Herbert Xu
On Sat, Mar 27, 2021 at 04:29:44PM +0800, Hui Tang wrote: > We must confirm the PASID is disabled before using no-sva mode. > > Signed-off-by: Hui Tang > --- > drivers/crypto/hisilicon/hpre/hpre_main.c | 43 > +-- > 1 file changed, 18 insertions(+), 25 deletions(-)

Re: [PATCH] crypto: hisilicon/hpre - fix a typo and delete redundant blank line

2021-04-02 Thread Herbert Xu
On Sat, Mar 27, 2021 at 04:32:08PM +0800, Hui Tang wrote: > s/shoul/should/ > > Signed-off-by: Hui Tang > --- > drivers/crypto/hisilicon/hpre/hpre_main.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.a

Re: [PATCH] crypto: hisilicon - delete redundant '\n'

2021-04-02 Thread Herbert Xu
On Sat, Mar 27, 2021 at 04:32:45PM +0800, Hui Tang wrote: > It has newline already by sysfs, so delete redundant '\n' > > Signed-off-by: Hui Tang > --- > drivers/crypto/hisilicon/hpre/hpre_main.c | 4 ++-- > drivers/crypto/hisilicon/sec2/sec_main.c | 2 +- > 2 files changed, 3 insertions(+), 3

Re: [PATCH] crypto: hisilicon/hpre - Add processing of src_data in 'CURVE25519'

2021-04-02 Thread Herbert Xu
On Sat, Mar 27, 2021 at 05:56:16PM +0800, Meng Yu wrote: > HPRE can only deal with src_data smaller than 'p' in 'CURVE25519' > algorithm, but 'rfc7748' says: > 'Implementations MUST accept non-canonical values and process them as > if they had been reduced modulo the field prime' > So we get its mo

Re: [PATCH] crypto: hisilicon/sec - Fixes AES algorithm mode parameter problem

2021-04-02 Thread Herbert Xu
On Sat, Mar 27, 2021 at 06:28:30PM +0800, Longfang Liu wrote: > The input data of the ECB (AES) algorithm needs to be aligned > with 16 bytes, and the input data of the XTS (AES) algorithm is > at least 16 bytes. Otherwise the SEC hardware will go wrong. > > Signed-off-by: Longfang Liu > --- > d

[PATCH] ecc: delete a useless function declaration

2021-04-02 Thread Meng Yu
This function declaration has been added in 'ecc_curve.h', delete it in 'crypto/ecc.h'. Fixes: 14bb76768275(crypto: ecc - expose ecc curves) Signed-off-by: Meng Yu --- crypto/ecc.h | 8 1 file changed, 8 deletions(-) diff --git a/crypto/ecc.h b/crypto/ecc.h index 46aa9bc..a006132 10064

Re: [PATCH] crypto: hisilicon/hpre - rsa key should not be empty

2021-04-02 Thread yumeng
在 2021/4/2 15:12, Herbert Xu 写道: On Fri, Mar 26, 2021 at 02:13:32PM +0800, Meng Yu wrote: We should ensure key is not empty before we set key. Signed-off-by: Meng Yu --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/h

Re: [PATCH] crypto: hisilicon/hpre - rsa key should not be empty

2021-04-02 Thread Herbert Xu
On Fri, Apr 02, 2021 at 06:16:16PM +0800, yumeng wrote: > > I think it is not a real bug, and soft fallback setkey can always catch the > error. > But our original intention was to make it don't go to 'xxx_set_pub_key' > when the key is null, and it can return an error earlier. > But maybe it is no

Re: [PATCH] ecc: delete a useless function declaration

2021-04-02 Thread Christophe Leroy
Le 02/04/2021 à 11:55, Meng Yu a écrit : This function declaration has been added in 'ecc_curve.h', delete it in 'crypto/ecc.h'. Fixes: 14bb76768275(crypto: ecc - expose ecc curves) Fixes tag is wrong I think, should be 4e6602916bc6 Signed-off-by: Meng Yu --- crypto/ecc.h | 8

Re: [PATCH][next] crypto: sun8i-ss: Fix memory leak of pad

2021-04-02 Thread Corentin Labbe
Le Thu, Apr 01, 2021 at 04:18:27PM +0100, Colin King a écrit : > From: Colin Ian King > > It appears there are several failure return paths that don't seem > to be free'ing pad. Fix these. > > Addresses-Coverity: ("Resource leak") > Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithm

[PATCH v2] crypto: hisilicon/qm - delete redundant code

2021-04-02 Thread Kai Ye
The "qdma" is a structure variable instead of actual data. This structure doesn't need to be zerod, The memset is useless and redundant. So delete it. Signed-off-by: Kai Ye --- Changes v1 -> v2: Re-edit the description. drivers/crypto/hisilicon/qm.c | 1 - 1 file changed, 1 deletion(-) diff -

[PATCH v2] crypto: hisilicon/hpre - delete redundant log

2021-04-02 Thread Hui Tang
'hpre_cfg_by_dsm' has checked and printed error path internally. It is not necessary to do it here, so remove it. Signed-off-by: Hui Tang v1 -> v2: - Return immediately when return value of 'hpre_cfg_by_dsm' is non-zero. --- drivers/crypto/hisilicon/hpre/hpre_main.c | 2 +- 1 file changed, 1 in

[PATCH] crypto: qat: Fix a double free in adf_create_ring

2021-04-02 Thread Lv Yunlong
In adf_create_ring, if the callee adf_init_ring() failed, the callee will free the ring->base_addr by dma_free_coherent() and return -EFAULT. Then adf_create_ring will goto err and the ring->base_addr will be freed again in adf_cleanup_ring(). My patch sets ring->base_addr to NULL after the first

[PATCH crypto] chcr: Read rxchannel-id from firmware

2021-04-02 Thread Ayush Sawal
The rxchannel id is updated by the driver using the port no value, but this does not ensure that the value is correct. So now rx channel value is obtained from etoc channel map value. Fixes: 567be3a5d227 ("crypto: chelsio - Use multiple txq/rxq per tfm to process the requests) Signed-off-by: Ayus