Re: [PATCH] crypto: crc32-generic - Use SPDX-License-Identifier

2021-04-16 Thread Herbert Xu
On Sat, Apr 10, 2021 at 10:30:16PM +0200, Christophe JAILLET wrote:
> Use SPDX-License-Identifier: GPL-2.0-only, instead of hand writing it.
> 
> This also removes a reference to http://www.xyratex.com which seems to be
> down.
> 
> Signed-off-by: Christophe JAILLET 
> ---
>  crypto/crc32_generic.c | 24 +---
>  1 file changed, 1 insertion(+), 23 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v3] crypto: hisilicon/hpre - delete redundant log and return in advance

2021-04-16 Thread Herbert Xu
On Sat, Apr 10, 2021 at 05:50:32PM +0800, Hui Tang wrote:
> 'hpre_cfg_by_dsm' has checked and printed error path internally. It is not
> necessary to do it here, so remove it.
> 
> It should return error immediately when return value of 'hpre_cfg_by_dsm'
> is non-zero, and no need to execute the remaining sentences.
> 
> Signed-off-by: Hui Tang 
> 
> ---
> v1 -> v2:
>- Return immediately when return value of 'hpre_cfg_by_dsm' is
>  non-zero.
> v2 -> v3:
>- Add description for return if function fails.
> ---
>  drivers/crypto/hisilicon/hpre/hpre_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: arm/curve25519 - Move '.fpu' after '.arch'

2021-04-16 Thread Herbert Xu
On Fri, Apr 09, 2021 at 03:11:55PM -0700, Nathan Chancellor wrote:
> Debian's clang carries a patch that makes the default FPU mode
> 'vfp3-d16' instead of 'neon' for 'armv7-a' to avoid generating NEON
> instructions on hardware that does not support them:
> 
> https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/raw/5a61ca6f21b4ad8c6ac4970e5ea5a7b5b4486d22/debian/patches/clang-arm-default-vfp3-on-armv7a.patch
> https://bugs.debian.org/841474
> https://bugs.debian.org/842142
> https://bugs.debian.org/914268
> 
> This results in the following build error when clang's integrated
> assembler is used because the '.arch' directive overrides the '.fpu'
> directive:
> 
> arch/arm/crypto/curve25519-core.S:25:2: error: instruction requires: NEON
>  vmov.i32 q0, #1
>  ^
> arch/arm/crypto/curve25519-core.S:26:2: error: instruction requires: NEON
>  vshr.u64 q1, q0, #7
>  ^
> arch/arm/crypto/curve25519-core.S:27:2: error: instruction requires: NEON
>  vshr.u64 q0, q0, #8
>  ^
> arch/arm/crypto/curve25519-core.S:28:2: error: instruction requires: NEON
>  vmov.i32 d4, #19
>  ^
> 
> Shuffle the order of the '.arch' and '.fpu' directives so that the code
> builds regardless of the default FPU mode. This has been tested against
> both clang with and without Debian's patch and GCC.
> 
> Cc: sta...@vger.kernel.org
> Fixes: d8f1308a025f ("crypto: arm/curve25519 - wire up NEON implementation")
> Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/118
> Reported-by: Arnd Bergmann 
> Suggested-by: Arnd Bergmann 
> Suggested-by: Jessica Clarke 
> Signed-off-by: Nathan Chancellor 
> ---
>  arch/arm/crypto/curve25519-core.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 0/3] crypto: hisilicon/hpre - add debug log

2021-04-16 Thread Herbert Xu
On Sat, Apr 10, 2021 at 05:46:58PM +0800, Hui Tang wrote:
> This patchset adds the debug log and cleanup code style.
> 
> Hui Tang (3):
>   crypto: hisilicon/hpre - delete the rudundant space after return
>   crypto: hisilicon/hpre - use the correct variable type
>   crypto: hisilicon/hpre - add debug log
> 
>  drivers/crypto/hisilicon/hpre/hpre_crypto.c | 11 +--
>  drivers/crypto/hisilicon/hpre/hpre_main.c   |  4 ++--
>  2 files changed, 11 insertions(+), 4 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v3 0/5] bug fix and clear coding style

2021-04-16 Thread Herbert Xu
On Fri, Apr 09, 2021 at 05:03:59PM +0800, Kai Ye wrote:
> Fixup coding style such as delete unneeded variable
> initialization. Add a comment for block size initialization.
> Add a data cleared operation in sg buf unmap, and other misc fix.
> 
> v1 -> v2:
>  1. fix [PATCH v2] error in v1.
>  2. v1 use a macro replace of magic number, v2 use a comment 
> for block size initialization.
> v2 -> v3:
>  fix a sparse warning
> 
> Kai Ye (5):
>   crypto: hisilicon/sgl - add a comment for block size initialization
>   crypto: hisilicon/sgl - delete unneeded variable initialization
>   crypto: hisilicon/sgl - add some dfx logs
>   crypto: hisilicon/sgl - fix the soft sg map to hardware sg
>   crypto: hisilicon/sgl - fix the sg buf unmap
> 
>  drivers/crypto/hisilicon/sgl.c | 37 +++--
>  1 file changed, 31 insertions(+), 6 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 0/2] crypto: correct the use of print format

2021-04-16 Thread Herbert Xu
On Thu, Apr 08, 2021 at 06:23:49PM +0800, Kai Ye wrote:
> According to Documentation/core-api/printk-formats.rst,
> Use the correct print format. Printing an unsigned int value should use %u
> instead of %d. Otherwise printk() might end up displaying negative numbers.
> 
> Kai Ye (2):
>   crypto/atmel - use the correct print format
>   crypto: hisilicon/sec_drv - use the correct print format
> 
>  drivers/crypto/atmel-i2c.c | 2 +-
>  drivers/crypto/atmel-sha.c | 4 ++--
>  drivers/crypto/hisilicon/sec/sec_drv.c | 6 +++---
>  3 files changed, 6 insertions(+), 6 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH -next 1/7] crypto: sun4i-ss - Fix PM reference leak when pm_runtime_get_sync() fails

2021-04-16 Thread Herbert Xu
On Thu, Apr 08, 2021 at 03:18:31PM +0800, Shixin Liu wrote:
> pm_runtime_get_sync will increment pm usage counter even it failed.
> Forgetting to putting operation will result in reference leak here.
> Fix it by replacing it with pm_runtime_resume_and_get to keep usage
> counter balanced.
> 
> Signed-off-by: Shixin Liu 
> ---
>  drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 2 +-
>  drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c   | 2 +-
>  drivers/crypto/allwinner/sun4i-ss/sun4i-ss-hash.c   | 2 +-
>  drivers/crypto/allwinner/sun4i-ss/sun4i-ss-prng.c   | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH -next 0/5] Remove redundant dev_err call

2021-04-16 Thread Herbert Xu
On Wed, Apr 07, 2021 at 10:18:14PM +0800, YueHaibing wrote:
> This patchset remove some redundant dev_err calls
> 
> YueHaibing (5):
>   crypto: atmel-tdes - Remove redundant dev_err call in
> atmel_tdes_probe()
>   crypto: img-hash - Remove redundant dev_err call in img_hash_probe()
>   crypto: ux500 - Remove redundant dev_err calls
>   crypto: keembay - Remove redundant dev_err calls
>   crypto: ccree - Remove redundant dev_err call in init_cc_resources()
> 
>  drivers/crypto/atmel-tdes.c   | 1 -
>  drivers/crypto/ccree/cc_driver.c  | 4 +---
>  drivers/crypto/img-hash.c | 3 ---
>  drivers/crypto/keembay/keembay-ocs-aes-core.c | 4 +---
>  drivers/crypto/keembay/keembay-ocs-hcu-core.c | 4 +---
>  drivers/crypto/ux500/cryp/cryp_core.c | 1 -
>  drivers/crypto/ux500/hash/hash_core.c | 1 -
>  7 files changed, 3 insertions(+), 15 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: hisilicon/trng - add version to adapt new algorithm

2021-04-16 Thread Herbert Xu
On Wed, Apr 07, 2021 at 05:44:33PM +0800, Weili Qian wrote:
> Kunpeng930 supports trng and prng, but Kunpeng920 only supports trng.
> 
> Therefore, version information is added to ensure that prng is not
> registered to Crypto subsystem on Kunpeng920.
> 
> Signed-off-by: Weili Qian 
> ---
>  drivers/crypto/hisilicon/trng/trng.c | 13 ++---
>  1 file changed, 10 insertions(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: hisilicon/qm - add stop queue by hardware

2021-04-16 Thread Herbert Xu
On Tue, Apr 06, 2021 at 08:56:02PM +0800, Weili Qian wrote:
> Kunpeng930 could be able to stop queue by writing hardware registers,
> which will trigger tasks in device to be flushed out.
> 
> In order to be compatible with the kunpeng920 driver, add 'qm_hw_ops_v3' to
> adapt Kunpeng930. And 'stop_qp' callback is added in 'qm_hw_ops_v3' to
> write hardware registers. Call 'stop_qp' to drain the tasks in device
> before releasing queue.
> 
> Signed-off-by: Weili Qian 
> Reviewed-by: Longfang Liu 
> ---
>  drivers/crypto/hisilicon/qm.c | 29 -
>  1 file changed, 28 insertions(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH -next] crypto: ixp4xx -: use DEFINE_SPINLOCK() for spinlock

2021-04-16 Thread Herbert Xu
On Tue, Apr 06, 2021 at 08:02:57PM +0800, Huang Guobin wrote:
> From: Guobin Huang 
> 
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
> 
> Reported-by: Hulk Robot 
> Signed-off-by: Guobin Huang 
> ---
>  drivers/crypto/ixp4xx_crypto.c | 7 ++-
>  1 file changed, 2 insertions(+), 5 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH -next] crypto: geode -: use DEFINE_SPINLOCK() for spinlock

2021-04-16 Thread Herbert Xu
On Tue, Apr 06, 2021 at 08:00:03PM +0800, Huang Guobin wrote:
> From: Guobin Huang 
> 
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
> 
> Reported-by: Hulk Robot 
> Signed-off-by: Guobin Huang 
> ---
>  drivers/crypto/geode-aes.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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

2021-04-16 Thread Herbert Xu
On Tue, Apr 06, 2021 at 10:32:59AM +0800, Meng Yu wrote:
> This function declaration has been added in 'ecc_curve.h',
> delete it in 'crypto/ecc.h'.
> 
> Fixes: 4e6602916bc6(crypto: ecdsa - Add support for ECDSA ...)
> Signed-off-by: Meng Yu 
> ---
> 
> v1 -> v2: Modify the 'Fixes tag' from '14bb76768275' to '4e6602916bc6 '.
> 
> ---
>  crypto/ecc.h | 8 
>  1 file changed, 8 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: hisilicon/hpre - fix unmapping invalid dma address

2021-04-16 Thread Herbert Xu
On Sat, Apr 10, 2021 at 05:49:17PM +0800, Hui Tang wrote:
> Currently, an invalid dma address may be unmapped when calling
> 'xx_data_clr_all' in error path, so check dma address of sqe in/out
> whether it has been mapped before calling 'dma_free_coherent' or
> 'dma_unmap_single'.
> 
> An abnormal case is as follows:
> hpre_curve25519_compute_value
>   -> hpre_curve25519_src_init
>   -> hpre_curve25519_hw_data_clr_all
> 
> Fixes: a9214b0b6ed2(crypto: hisilicon - fix the check on dma address)
> Signed-off-by: Hui Tang 
> ---
>  drivers/crypto/hisilicon/hpre/hpre_crypto.c | 18 ++
>  1 file changed, 18 insertions(+)

This triggers new sparse warnings.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v2 0/8] ccp: KVM: SVM: Use stack for SEV command buffers

2021-04-15 Thread Herbert Xu
On Thu, Apr 15, 2021 at 01:15:59PM -0500, Tom Lendacky wrote:
> On 4/15/21 11:09 AM, Paolo Bonzini wrote:
> > On 07/04/21 20:00, Tom Lendacky wrote:
> >> For the series:
> >>
> >> Acked-by: Tom Lendacky
> > 
> > Shall I take this as a request (or permission, whatever :)) to merge it
> > through the KVM tree?
> 
> Adding Herbert. Here's a link to the series:
> 
> https://lore.kernel.org/kvm/88eef561-6fd8-a495-0d60-ff688070c...@redhat.com/T/#m2bbdd12452970d3bd7d0b1464c22bf2f0227a9f1
> 
> I'm not sure how you typically do the cross-tree stuff. Patch 8 has a
> requirement on patches 1-7. The arch/x86/kvm/svm/sev.c file tends to have
> more activity/changes than drivers/crypto/ccp/sev-dev.{c,h}, so it would
> make sense to take it through the KVM tree. But I think you need to verify
> that with Herbert.

I don't mind at all.  Paolo you can take this through your tree.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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

2021-04-09 Thread Herbert Xu
On Fri, Apr 02, 2021 at 10:13:48AM -0700, Lv Yunlong wrote:
> 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 freed to avoid the
> double free.
> 
> Fixes: a672a9dc872ec ("crypto: qat - Intel(R) QAT transport code")
> Signed-off-by: Lv Yunlong 
> ---
>  drivers/crypto/qat/qat_common/adf_transport.c | 1 +
>  1 file changed, 1 insertion(+)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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

2021-04-09 Thread Herbert Xu
On Fri, Apr 02, 2021 at 07:22:30PM +0800, Kai Ye wrote:
> 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(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto:hisilicon/sec - fixup checking the 3DES weak key

2021-04-09 Thread Herbert Xu
On Fri, Apr 02, 2021 at 10:47:57AM +0800, Kai Ye wrote:
> skcipher: Add a verifying to check whether the triple DES key
> is weak.
> 
> Signed-off-by: Kai Ye 
> ---
>  drivers/crypto/hisilicon/sec2/sec_crypto.c | 13 +++--
>  1 file changed, 11 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH][V2] crypto: sa2ul: Fix memory leak of rxd

2021-04-09 Thread Herbert Xu
On Thu, Apr 01, 2021 at 04:28:39PM +0100, Colin King wrote:
> From: Colin Ian King 
> 
> There are two error return paths that are not freeing rxd and causing
> memory leaks.  Fix these.
> 
> Addresses-Coverity: ("Resource leak")
> Fixes: 00c9211f60db ("crypto: sa2ul - Fix DMA mapping API usage")
> Signed-off-by: Colin Ian King 
> ---
> 
> V2: Fix typo in $SUBJECT
> 
> ---
>  drivers/crypto/sa2ul.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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

2021-04-09 Thread Herbert Xu
On Thu, Apr 01, 2021 at 04:18:27PM +0100, Colin King wrote:
> 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 algorithms")
> Signed-off-by: Colin Ian King 
> ---
>  drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: rockchip/rk3288_crypto_ahash - delete unneeded variable initialization

2021-04-09 Thread Herbert Xu
On Thu, Apr 01, 2021 at 11:01:39AM +0800, Kai Ye wrote:
> Delete unneeded variable initialization
> 
> Signed-off-by: Kai Ye 
> ---
>  drivers/crypto/rockchip/rk3288_crypto_ahash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH -next] crypto: ccp - Use DEFINE_SPINLOCK() for spinlock

2021-04-09 Thread Herbert Xu
On Wed, Mar 31, 2021 at 10:00:55AM +0800, Tang Yizhou wrote:
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
> 
> Reported-by: Hulk Robot 
> Signed-off-by: Tang Yizhou 
> ---
>  drivers/crypto/ccp/ccp-crypto-main.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH -next] crypto: hisilicon/hpre - fix a typo in hpre_crypto.c

2021-04-09 Thread Herbert Xu
On Tue, Mar 30, 2021 at 07:51:24AM -0400, Ruiqi Gong wrote:
> Do a trivial typo fix.
> s/discribed/described
> 
> Reported-by: Hulk Robot 
> Signed-off-by: Ruiqi Gong 
> ---
>  drivers/crypto/hisilicon/hpre/hpre_crypto.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: ccp -A value assigned to a variable is never used.

2021-04-09 Thread Herbert Xu
On Tue, Mar 30, 2021 at 06:10:29PM +0800, Jiapeng Chong wrote:
> Fix the following whitescan warning:
> 
> Assigning value "64" to "dst.address" here, but that stored value is
> overwritten before it can be used.
> 
> Reported-by: Abaci Robot 
> Signed-off-by: Jiapeng Chong 
> ---
>  drivers/crypto/ccp/ccp-ops.c | 1 -
>  1 file changed, 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v2] crypto: hisilicon/sec - Fix a module parameter error

2021-04-09 Thread Herbert Xu
On Tue, Mar 30, 2021 at 04:02:32PM +0800, Longfang Liu wrote:
> ctx_q_num is a module parameter set by the user to specify the
> number of qp queues required to create a ctx.
> 
> When the number of qp queues allocated by PF or VF is less than
> the ctx_q_num, an error will be reported when ctx is initialized
> in kernel mode, which leads to the problem that the registered
> algorithms cannot be used.
> 
> Therefore, when PF or VF is initialized, if the number of qp queues
> is not enough to create a ctx, the kernel mode cannot be used,
> and there is no need to register the kernel mode algorithms.
> 
> Signed-off-by: Longfang Liu 
> ---
> 
> Changes in V2:
>  - Add algorithms unregistration processing
> 
>  drivers/crypto/hisilicon/sec2/sec_main.c | 17 -
>  1 file changed, 12 insertions(+), 5 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: crypto: possible NULL reference

2021-04-09 Thread Herbert Xu
On Mon, Mar 29, 2021 at 09:11:17PM -0700, Randy Dunlap wrote:
>
> Is there something else protecting the improper use of 
> in these cases?  or is a patch warranted?

The curve ID is always hard-coded and AFAIK we don't have any
use-cases where an unsupported curve ID is used.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: allwinner: add missing CRYPTO_ prefix

2021-04-09 Thread Herbert Xu
On Mon, Mar 29, 2021 at 10:12:00PM +0200, Corentin Labbe wrote:
> Some CONFIG select miss CRYPTO_.
> 
> Reported-by: Chen-Yu Tsai 
> Fixes: 56f6d5aee88d1 ("crypto: sun8i-ce - support hash algorithms")
> Fixes: d9b45418a9177 ("crypto: sun8i-ss - support hash algorithms")
> Signed-off-by: Corentin Labbe 
> ---
>  drivers/crypto/allwinner/Kconfig | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v2 5/5] crypto: hisilicon/sgl - fix the sg buf unmap

2021-04-09 Thread Herbert Xu
On Tue, Mar 30, 2021 at 03:39:06PM +0800, Kai Ye wrote:
> Add clear data operation for sge data.
> 
> Signed-off-by: Kai Ye 
> ---
>  drivers/crypto/hisilicon/sgl.c | 14 +-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/hisilicon/sgl.c b/drivers/crypto/hisilicon/sgl.c
> index c618aaf..7a58ab3 100644
> --- a/drivers/crypto/hisilicon/sgl.c
> +++ b/drivers/crypto/hisilicon/sgl.c
> @@ -189,6 +189,18 @@ static void update_hw_sgl_sum_sge(struct hisi_acc_hw_sgl 
> *hw_sgl, u16 sum)
>   hw_sgl->entry_sum_in_chain = cpu_to_le16(sum);
>  }
>  
> +static void clear_hw_sgl_sge(struct hisi_acc_hw_sgl *hw_sgl)
> +{
> + struct acc_hw_sge *hw_sge = hw_sgl->sge_entries;
> + int i;
> +
> + for (i = 0; i < hw_sgl->entry_sum_in_sgl; i++) {
> + hw_sge[i].page_ctrl = NULL;
> + hw_sge[i].buf = 0;
> + hw_sge[i].len = 0;
> + }
> +}

This causes a new sparse warning:

  CHECK   ../drivers/crypto/hisilicon/sgl.c
  ../drivers/crypto/hisilicon/sgl.c:200:31: warning: restricted __le16 degrades 
to integer

Please fix.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: chelsio: fix incorrect kernel-doc comment syntax in file

2021-04-09 Thread Herbert Xu
On Mon, Mar 29, 2021 at 04:15:14PM +0530, Aditya Srivastava wrote:
> The opening comment mark '/**' is used for highlighting the beginning of
> kernel-doc comments.
> The header for drivers/crypto/chelsio/chcr_core.c follows this syntax, but
> the content inside does not comply with kernel-doc.
> 
> This line was probably not meant for kernel-doc parsing, but is parsed
> due to the presence of kernel-doc like comment syntax(i.e, '/**'), which
> causes unexpected warning from kernel-doc:
> "warning: wrong kernel-doc identifier on line:
>  * This file is part of the Chelsio T4/T5/T6 Ethernet driver for Linux."
> 
> Provide a simple fix by replacing this occurrence with general comment
> format, i.e. '/*', to prevent kernel-doc from parsing it.
> 
> Signed-off-by: Aditya Srivastava 
> ---
>  drivers/crypto/chelsio/chcr_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This patch doesn't apply against cryptodev.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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

2021-04-09 Thread Herbert Xu
On Fri, Apr 02, 2021 at 07:24:29PM +0800, Hui Tang wrote:
> '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 insertion(+), 1 deletion(-)

Your patch description is misleading as the patch does moe than
just remove the redundant printk.  Please rephrase so that it is
clear that the patch is in fact changing behaviour.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: cbc - fix coding style

2021-04-09 Thread Herbert Xu
On Thu, Apr 01, 2021 at 03:31:41PM +0800, Zhiqi Song wrote:
> Fixed following checkpatch error:
> - do not use assignment in if condition
> 
> Signed-off-by: Zhiqi Song 
> ---
>  crypto/cbc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

This patch does not appear to improve the code.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: api - fix coding style

2021-04-09 Thread Herbert Xu
On Thu, Apr 01, 2021 at 03:20:49PM +0800, Zhiqi Song wrote:
> Fixed following checkpatch error:
> - do not use assignment in if condition
> Fixed following checkpatch warning:
> - prefer strscpy over strlcpy
> - delete repeated word
> 
> Signed-off-by: Zhiqi Song 
> ---
>  crypto/api.c | 20 
>  1 file changed, 12 insertions(+), 8 deletions(-)

Please don't mix unrelated changes in a single patch.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: deflate - Remove useless call "zlib_inflateEnd"

2021-04-09 Thread Herbert Xu
On Wed, Mar 31, 2021 at 11:34:57AM +0800, Jiapeng Chong wrote:
> Fix the following whitescan warning:
> 
> Calling "zlib_inflateEnd(>decomp_stream)" is only useful for its
> return value, which is ignored.
> 
> Reported-by: Abaci Robot 
> Signed-off-by: Jiapeng Chong 
> ---
>  crypto/deflate.c | 1 -
>  1 file changed, 1 deletion(-)

The function might not do anything today but the documentation
clearly indicates that it could free any dynamically allocated
data so it should stay.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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 not good.

It might make sense to check them twice if you were touching them
directly, e.g., poking inside the key.  However, it appears that
your driver simply palms off the key to rsa_helper.c which should
check the key/keylen too so I think there is no need for this patch
for now.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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 
> ---
>  drivers/crypto/hisilicon/sec2/sec_crypto.c | 37 
> ++
>  1 file changed, 32 insertions(+), 5 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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 modulus to p, and then deal it with HPRE.
> 
> Signed-off-by: Meng Yu 
> ---
>  drivers/crypto/hisilicon/hpre/hpre_crypto.c | 22 ++
>  1 file changed, 18 insertions(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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 char[16]’} with mismatched bound 
> [-Werror=array-parameter=]
>13 | void poly1305_core_setkey(struct poly1305_core_key *key, const u8 
> raw_key[16])
>   |  
> ~^~~
> In file included from lib/crypto/poly1305-donna32.c:11:
> include/crypto/internal/poly1305.h:21:68: note: previously declared as ‘const 
> u8 *’ {aka ‘const unsigned char *’}
>21 | void poly1305_core_setkey(struct poly1305_core_key *key, const u8 
> *raw_key);
> 
> This is harmless in principle, as the calling conventions are the same,
> but the more specific prototype allows better type checking in the
> caller.
> 
> Change the declaration to match the actual function definition.
> The poly1305_simd_init() is a bit suspicious here, as it previously
> had a 32-byte argument type, but looks like it needs to take the
> 16-byte POLY1305_BLOCK_SIZE array instead.
> 
> Fixes: 1c08a104360f ("crypto: poly1305 - add new 32 and 64-bit generic 
> versions")
> Signed-off-by: Arnd Bergmann 
> ---
>  arch/arm/crypto/poly1305-glue.c| 2 +-
>  arch/arm64/crypto/poly1305-glue.c  | 2 +-
>  arch/mips/crypto/poly1305-glue.c   | 2 +-
>  arch/x86/crypto/poly1305_glue.c| 6 +++---
>  include/crypto/internal/poly1305.h | 3 ++-
>  include/crypto/poly1305.h  | 6 --
>  lib/crypto/poly1305-donna32.c  | 3 ++-
>  lib/crypto/poly1305-donna64.c  | 3 ++-
>  lib/crypto/poly1305.c  | 3 ++-
>  9 files changed, 18 insertions(+), 12 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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 describe the 'sqe' operations. The driver only
> need to choose the 'ops' once when call 'hisi_zip_acomp_init'.
> 
> v1 -> v2:
> * fix a sparse warning
> 
> Yang Shen (4):
>   crypto: hisilicon/zip - adjust functions location
>   crypto: hisilicon/zip - add comments for 'hisi_zip_sqe'
>   crypto: hisilicon/zip - initialize operations about 'sqe' in
> 'acomp_alg.init'
>   crypto: hisilicon/zip - support new 'sqe' type in Kunpeng930
> 
>  drivers/crypto/hisilicon/zip/zip.h|  46 +-
>  drivers/crypto/hisilicon/zip/zip_crypto.c | 706 
> +-
>  2 files changed, 438 insertions(+), 314 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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-cry...@vger.kernel.org
> Cc: Andy Lutomirski 
> Cc: Jann Horn 
> Cc: Theodore Ts'o 
> Reviewed-by: Andy Lutomirski 
> Acked-by: Ard Biesheuvel 
> Signed-off-by: Eric Biggers 
> ---
> drivers/char/random.c | 17 ++-
> include/trace/events/random.h | 83 ---
> 2 files changed, 3 insertions(+), 97 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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 to always use the standard constants.
> 
> Cc: linux-cry...@vger.kernel.org
> Cc: Andy Lutomirski 
> Cc: Jann Horn 
> Cc: Theodore Ts'o 
> Acked-by: Herbert Xu 
> Acked-by: Ard Biesheuvel 
> Signed-off-by: Eric Biggers 
> ---
>  drivers/char/random.c   | 4 ++--
>  include/crypto/chacha.h | 9 +++--
>  2 files changed, 9 insertions(+), 4 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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 --git a/drivers/crypto/hisilicon/hpre/hpre_main.c 
> b/drivers/crypto/hisilicon/hpre/hpre_main.c
> index 8aae921..73ee997 100644
> --- a/drivers/crypto/hisilicon/hpre/hpre_main.c
> +++ b/drivers/crypto/hisilicon/hpre/hpre_main.c
> @@ -384,10 +384,7 @@ static int hpre_set_user_domain_and_cache(struct hisi_qm 
> *qm)
>  
>   /* This setting is only needed by Kunpeng 920. */
>   if (qm->ver == QM_HW_V2) {
> - ret = hpre_cfg_by_dsm(qm);
> - if (ret)
> - dev_err(dev, "acpi_evaluate_dsm err.\n");
> -
> + hpre_cfg_by_dsm(qm);
>   disable_flr_of_bme(qm);
>   }

If the return value is non-zero you've just changed what this code
does from returning non-zero to returning zero.  Are you sure about
this?

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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.c 
> b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
> index 53068d2..7cf7d80 100644
> --- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c
> +++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
> @@ -1093,6 +1093,9 @@ static int hpre_rsa_setpubkey(struct crypto_akcipher 
> *tfm, const void *key,
>   struct hpre_ctx *ctx = akcipher_tfm_ctx(tfm);
>   int ret;
>  
> + if (!key || !keylen)
> + return -EINVAL;
> +
>   ret = crypto_akcipher_set_pub_key(ctx->rsa.soft_tfm, key, keylen);

Does this fix a real bug? Wouldn't the soft fallback setkey catch
this anyhow?

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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.

But your patch description is poorly written and needs to be
rephrased to describe more clearly why it is safe to remove
the memset.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v1 3/3] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys

2021-03-31 Thread Herbert Xu
On Wed, Mar 31, 2021 at 04:34:29PM -0700, Eric Biggers wrote:
> On Thu, Apr 01, 2021 at 02:31:46AM +0300, Jarkko Sakkinen wrote:
> > 
> > It's a bummer but uapi is the god in the end. Since TPM does not do it
> > today, that behaviour must be supported forever. That's why a boot option
> > AND a warning would be the best compromise.
> 
> It's not UAPI if there is no way for userspace to tell if it changed.

Exactly.  UAPI is only an issue if something *breaks*.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 01/18] X.509: Parse RSASSA-PSS style certificates

2021-03-31 Thread Herbert Xu
On Tue, Mar 30, 2021 at 10:28:12PM +0200, Varad Gautam wrote:
> An X.509 wrapper for a RSASSA-PSS signature contains additional
> signature parameters over the PKCSv.15 encoding scheme. Extend the
> x509 parser to allow parsing RSASSA-PSS encoded certificates, with
> the defaults taken from RFC8017.

Where is the cover letter for this series?

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] Documentation: crypto: add info about "fips=" boot option

2021-03-29 Thread Herbert Xu
On Mon, Mar 29, 2021 at 10:00:45PM -0700, Randy Dunlap wrote:
> On 3/29/21 9:37 PM, Herbert Xu wrote:
> > On Mon, Mar 29, 2021 at 09:00:01PM -0700, Randy Dunlap wrote:
> >>
> >> +  If fips_enabled = 1, some crypto tests are skipped.
> > 
> > I don't think any tests are skipped.  It does however disable
> > many algorithms by essentially failing them at the testing stage.
> 
> That statement was based on crypto/testmgr.c (in 4 places):
> 
>   if (fips_enabled && template[i].fips_skip)
>   continue;

By skipping the test, the algorithm effectively fails the self-test
and therefore is disabled.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] Documentation: crypto: add info about "fips=" boot option

2021-03-29 Thread Herbert Xu
On Mon, Mar 29, 2021 at 09:00:01PM -0700, Randy Dunlap wrote:
>
> + If fips_enabled = 1, some crypto tests are skipped.

I don't think any tests are skipped.  It does however disable
many algorithms by essentially failing them at the testing stage.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: vmx: fix incorrect kernel-doc comment syntax in files

2021-03-26 Thread Herbert Xu
On Sun, Mar 21, 2021 at 01:55:25AM +0530, Aditya Srivastava wrote:
> The opening comment mark '/**' is used for highlighting the beginning of
> kernel-doc comments.
> There are certain files in drivers/crypto/vmx, which follow this syntax,
> but the content inside does not comply with kernel-doc.
> Such lines were probably not meant for kernel-doc parsing, but are parsed
> due to the presence of kernel-doc like comment syntax(i.e, '/**'), which
> causes unexpected warnings from kernel-doc.
> 
> E.g., presence of kernel-doc like comment in the header line for
> drivers/crypto/vmx/vmx.c causes this warning by kernel-doc:
> 
> "warning: expecting prototype for Routines supporting VMX instructions on the 
> Power 8(). Prototype was for p8_init() instead"
> 
> Similarly for other files too.
> 
> Provide a simple fix by replacing such occurrences with general comment
> format, i.e. '/*', to prevent kernel-doc from parsing it.
> 
> Signed-off-by: Aditya Srivastava 
> ---
> * Applies perfectly on next-20210319
> 
>  drivers/crypto/vmx/aes.c | 2 +-
>  drivers/crypto/vmx/aes_cbc.c | 2 +-
>  drivers/crypto/vmx/aes_ctr.c | 2 +-
>  drivers/crypto/vmx/aes_xts.c | 2 +-
>  drivers/crypto/vmx/ghash.c   | 2 +-
>  drivers/crypto/vmx/vmx.c     | 2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: nx: fix incorrect kernel-doc comment syntax in files

2021-03-26 Thread Herbert Xu
On Sun, Mar 21, 2021 at 06:00:07PM +0530, Aditya Srivastava wrote:
> The opening comment mark '/**' is used for highlighting the beginning of
> kernel-doc comments.
> There are certain files in drivers/crypto/nx, which follow this syntax,
> but the content inside does not comply with kernel-doc.
> Such lines were probably not meant for kernel-doc parsing, but are parsed
> due to the presence of kernel-doc like comment syntax(i.e, '/**'), which
> causes unexpected warnings from kernel-doc.
> 
> E.g., presence of kernel-doc like comment in the header lines for
> drivers/crypto/nx/nx-sha256.c at header causes these warnings:
> "warning: Function parameter or member 'tfm' not described in 
> 'nx_crypto_ctx_sha256_init'"
> "warning: expecting prototype for SHA(). Prototype was for 
> nx_crypto_ctx_sha256_init() instead"
> 
> Similarly for other files too.
> 
> Provide a simple fix by replacing such occurrences with general comment
> format, i.e. '/*', to prevent kernel-doc from parsing it.
> 
> Signed-off-by: Aditya Srivastava 
> ---
> * Applies perfectly on next-20210319
> 
>  drivers/crypto/nx/nx-aes-cbc.c  | 2 +-
>  drivers/crypto/nx/nx-aes-ccm.c  | 2 +-
>  drivers/crypto/nx/nx-aes-ctr.c  | 2 +-
>  drivers/crypto/nx/nx-aes-ecb.c  | 2 +-
>  drivers/crypto/nx/nx-aes-gcm.c  | 2 +-
>  drivers/crypto/nx/nx-aes-xcbc.c | 2 +-
>  drivers/crypto/nx/nx-sha256.c   | 2 +-
>  drivers/crypto/nx/nx-sha512.c   | 2 +-
>  drivers/crypto/nx/nx.c  | 2 +-
>  drivers/crypto/nx/nx_debugfs.c  | 2 +-
>  10 files changed, 10 insertions(+), 10 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: ux500: fix incorrect kernel-doc comment syntax

2021-03-26 Thread Herbert Xu
On Sun, Mar 21, 2021 at 05:39:12PM +0530, Aditya Srivastava wrote:
> The opening comment mark '/**' is used for highlighting the beginning of
> kernel-doc comments.
> There are certain files in drivers/crypto/ux500, which follow this syntax,
> but the content inside does not comply with kernel-doc.
> Such lines were probably not meant for kernel-doc parsing, but are parsed
> due to the presence of kernel-doc like comment syntax(i.e, '/**'), which
> causes unexpected warnings from kernel-doc.
> 
> E.g., presence of kernel-doc like comment in the header lines for
> drivers/crypto/ux500/cryp/cryp.h at header causes this warning:
> 
> "warning: expecting prototype for ST(). Prototype was for _CRYP_H_() instead"
> 
> Similarly for other files too.
> 
> Provide a simple fix by replacing such occurrences with general comment
> format, i.e. '/*', to prevent kernel-doc from parsing it.
> 
> Signed-off-by: Aditya Srivastava 
> ---
>  drivers/crypto/ux500/cryp/cryp.c  |  2 +-
>  drivers/crypto/ux500/cryp/cryp.h  |  2 +-
>  drivers/crypto/ux500/cryp/cryp_core.c |  2 +-
>  drivers/crypto/ux500/cryp/cryp_irq.c  |  2 +-
>  drivers/crypto/ux500/cryp/cryp_irq.h  |  4 ++--
>  drivers/crypto/ux500/cryp/cryp_irqp.h |  4 ++--
>  drivers/crypto/ux500/cryp/cryp_p.h| 14 +++---
>  7 files changed, 15 insertions(+), 15 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: amcc: fix incorrect kernel-doc comment syntax in files

2021-03-26 Thread Herbert Xu
On Sun, Mar 21, 2021 at 05:38:32PM +0530, Aditya Srivastava wrote:
> The opening comment mark '/**' is used for highlighting the beginning of
> kernel-doc comments.
> There are certain files in drivers/crypto/amcc, which follow this syntax,
> but the content inside does not comply with kernel-doc.
> Such lines were probably not meant for kernel-doc parsing, but are parsed
> due to the presence of kernel-doc like comment syntax(i.e, '/**'), which
> causes unexpected warnings from kernel-doc.
> 
> E.g., presence of kernel-doc like comment in
> drivers/crypto/amcc/crypto4xx_alg.c at header, and some other lines,
> causes these warnings by kernel-doc:
> 
> "warning: expecting prototype for AMCC SoC PPC4xx Crypto Driver(). Prototype 
> was for set_dynamic_sa_command_0() instead"
> "warning: Function parameter or member 'dir' not described in 
> 'set_dynamic_sa_command_0'"
> etc..
> 
> Provide a simple fix by replacing such occurrences with general comment
> format, i.e. '/*', to prevent kernel-doc from parsing it.
> 
> Signed-off-by: Aditya Srivastava 
> ---
>  drivers/crypto/amcc/crypto4xx_alg.c | 12 ++--
>  drivers/crypto/amcc/crypto4xx_core.c| 18 +-
>  drivers/crypto/amcc/crypto4xx_core.h|  4 ++--
>  drivers/crypto/amcc/crypto4xx_reg_def.h |  8 
>  drivers/crypto/amcc/crypto4xx_sa.h  | 18 +-
>  drivers/crypto/amcc/crypto4xx_trng.h    |  2 +-
>  6 files changed, 31 insertions(+), 31 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 0/4] crypto: hisilicon/qm - support doorbell isolation and queue number configuration

2021-03-26 Thread Herbert Xu
On Sat, Mar 20, 2021 at 07:27:42PM +0800, Weili Qian wrote:
> Kunpeng930 supports getting the number of queues from hardware registers
> and queue doorbell isolation.
> 
> This patchset configures the total number of hardware queues and the
> maximum number of function queues, and supports queue doorbell isolation.
> 
> Weili Qian (4):
>   crypto: hisilicon/qm - set the total number of queues
>   crypto: hisilicon/qm - move 'CURRENT_QM' code to qm.c
>   crypto: hisilicon/qm - set the number of queues for function
>   crypto: hisilicon/qm - add queue isolation support for Kunpeng 930
> 
>  drivers/crypto/hisilicon/hpre/hpre.h  |   1 -
>  drivers/crypto/hisilicon/hpre/hpre_main.c |  64 --
>  drivers/crypto/hisilicon/qm.c | 332 
> +++---
>  drivers/crypto/hisilicon/qm.h |  17 +-
>  drivers/crypto/hisilicon/sec2/sec.h   |   1 -
>  drivers/crypto/hisilicon/sec2/sec_main.c  |  65 +-
>  drivers/crypto/hisilicon/zip/zip_main.c   |  65 +-
>  include/uapi/misc/uacce/hisi_qm.h |   1 +
>  8 files changed, 272 insertions(+), 274 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: hisilicon/hpre - fix Kconfig

2021-03-26 Thread Herbert Xu
On Fri, Mar 19, 2021 at 06:45:39PM +0800, Hui Tang wrote:
> hpre select 'CRYPTO_ECDH' and 'CRYPTO_CURVE25519'.
> 
> Signed-off-by: Hui Tang 
> ---
>  drivers/crypto/hisilicon/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: hisilicon/hpre - fix "hpre_ctx_init" resource leak

2021-03-26 Thread Herbert Xu
On Fri, Mar 19, 2021 at 06:45:27PM +0800, Hui Tang wrote:
> When calling "hpre_ctx_set" fails, stop and put qp,
> otherwise will leak qp resource.
> 
> Signed-off-by: Hui Tang 
> ---
>  drivers/crypto/hisilicon/hpre/hpre_crypto.c | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: hisilicon - fix the check on dma address

2021-03-26 Thread Herbert Xu
On Fri, Mar 19, 2021 at 06:45:05PM +0800, Hui Tang wrote:
> System may be able to get physical address of zero if not reserved by
> firmware.
> 
> The dma address obtained by 'dma_alloc_coherent' is valid, since already
> checking cpu va before, so do not check again.
> 
> Signed-off-by: Hui Tang 
> ---
>  drivers/crypto/hisilicon/hpre/hpre_crypto.c | 12 
>  drivers/crypto/hisilicon/qm.c   |  2 +-
>  drivers/crypto/hisilicon/sec2/sec_crypto.c  |  6 --
>  3 files changed, 1 insertion(+), 19 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 0/2] crypto: hisilicon/hpre - remove 'CONFIG_CRYPTO_DH'

2021-03-26 Thread Herbert Xu
On Fri, Mar 19, 2021 at 06:44:17PM +0800, Hui Tang wrote:
> Remove 'CONFIG_CRYPTO_DH' and optimise 'hpre_algs_register' error path.
> 
> Hui Tang (2):
>   crypto: hisilicon/hpre - delete wrap of 'CONFIG_CRYPTO_DH'
>   crypto: hisilicon/hpre - optimise 'hpre_algs_register' error path
> 
>  drivers/crypto/hisilicon/hpre/hpre_crypto.c | 30 
> ++---
>  1 file changed, 10 insertions(+), 20 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: Correct an error in the comments

2021-03-26 Thread Herbert Xu
On Fri, Mar 19, 2021 at 05:13:34PM +0800, Meng Yu wrote:
> Remove repeated word 'bit' in comments.
> 
> Signed-off-by: Meng Yu 
> ---
>  crypto/ecc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v3 00/10] Rid W=1 warnings in Crypto

2021-03-26 Thread Herbert Xu
On Thu, Mar 18, 2021 at 12:44:12PM +, Lee Jones wrote:
> This is set 1 of 2 sets required to fully clean Crypto.
> 
> v2: No functional changes since v1.
> v3: Description change and additional struct header fix
> 
> Lee Jones (10):
>   crypto: hisilicon: sec_drv: Supply missing description for
> 'sec_queue_empty()'s 'queue' param
>   crypto: bcm: Fix a whole host of kernel-doc misdemeanours
>   crypto: chelsio: chcr_core: Fix some kernel-doc issues
>   crypto: ux500: hash: hash_core: Fix worthy kernel-doc headers and
> remove others
>   crypto: keembay: ocs-hcu: Fix incorrectly named functions/structs
>   crypto: atmel-ecc: Struct headers need to start with keyword 'struct'
>   crypto: caam: caampkc: Provide the name of the function and provide
> missing descriptions
>   crypto: vmx: Source headers are not good kernel-doc candidates
>   crypto: nx: nx-aes-cbc: Repair some kernel-doc problems
>   crypto: cavium: nitrox_isr: Demote non-compliant kernel-doc headers
> 
>  drivers/crypto/atmel-ecc.c|  2 +-
>  drivers/crypto/bcm/cipher.c   |  7 ++--
>  drivers/crypto/bcm/spu.c  | 16 -
>  drivers/crypto/bcm/spu2.c | 43 +--
>  drivers/crypto/bcm/util.c |  4 +--
>  drivers/crypto/caam/caamalg_qi2.c |  3 ++
>  drivers/crypto/caam/caampkc.c |  3 +-
>  drivers/crypto/cavium/nitrox/nitrox_isr.c |  4 +--
>  drivers/crypto/chelsio/chcr_algo.c|  8 ++---
>  drivers/crypto/chelsio/chcr_core.c|  2 +-
>  drivers/crypto/hisilicon/sec/sec_drv.c|  1 +
>  drivers/crypto/keembay/ocs-hcu.c  |  8 ++---
>  drivers/crypto/nx/nx-aes-cbc.c|  2 +-
>  drivers/crypto/nx/nx.c|  5 +--
>  drivers/crypto/nx/nx_debugfs.c|  2 +-
>  drivers/crypto/ux500/cryp/cryp.c  |  5 +--
>  drivers/crypto/ux500/cryp/cryp_core.c |  5 +--
>  drivers/crypto/ux500/cryp/cryp_irq.c  |  2 +-
>  drivers/crypto/ux500/hash/hash_core.c | 15 +++-
>  drivers/crypto/vmx/vmx.c  |  2 +-
>  20 files changed, 73 insertions(+), 66 deletions(-)
> 
> Cc: Alexandre Belloni 
> Cc: Andreas Westin 
> Cc: Atul Gupta 
> Cc: Aymen Sghaier 
> Cc: Ayush Sawal 
> Cc: Benjamin Herrenschmidt 
> Cc: Berne Hebark 
> Cc: "Breno Leitão" 
> Cc: Daniele Alessandrelli 
> Cc: "David S. Miller" 
> Cc: Declan Murphy 
> Cc: Harsh Jain 
> Cc: Henrique Cerri 
> Cc: Herbert Xu 
> Cc: "Horia Geantă" 
> Cc: Jitendra Lulla 
> Cc: Joakim Bech 
> Cc: Jonas Linde 
> Cc: Jonathan Cameron 
> Cc: Kent Yoder 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-cry...@vger.kernel.org
> Cc: linuxppc-...@lists.ozlabs.org
> Cc: Ludovic Desroches 
> Cc: Manoj Malviya 
> Cc: Michael Ellerman 
> Cc: M R Gowda 
> Cc: Nayna Jain 
> Cc: Nicolas Ferre 
> Cc: Niklas Hernaeus 
> Cc: Paul Mackerras 
> Cc: Paulo Flabiano Smorigo 
> Cc: Rob Rice 
> Cc: Rohit Maheshwari 
> Cc: Shujuan Chen 
> Cc: Tudor Ambarus 
> Cc: Vinay Kumar Yadav 
> Cc: Zaibo Xu 

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v5 0/2] crypto: qat - fix couple crashes duing error handling

2021-03-26 Thread Herbert Xu
On Thu, Mar 18, 2021 at 11:39:58PM -0400, Tong Zhang wrote:
> There are a couple of issues in qat error handling. Those drivers tries to
> release resources that is not initialized. This patch series tries to fix
> crashes caused by incorrect error handling.
> 
> v2: removed excessive dump in commit log as suggested by Andy Shevchenko 
> 
> v3: collect tags as suggested by Andy Shevchenko 
> v4: fix commit log typos
> v5: fix headline
> 
> Tong Zhang (2):
>   crypto: qat - don't release uninitialized resources
>   crypto: qat - ADF_STATUS_PF_RUNNING should be set after adf_dev_init
> 
>  drivers/crypto/qat/qat_c3xxxvf/adf_drv.c|  4 ++--
>  drivers/crypto/qat/qat_c62xvf/adf_drv.c |  4 ++--
>  drivers/crypto/qat/qat_common/adf_vf_isr.c  | 17 +
>  drivers/crypto/qat/qat_dh895xccvf/adf_drv.c |  4 ++--
>  4 files changed, 19 insertions(+), 10 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: inside-secure: Minor typo fix in the file safexcel.c

2021-03-26 Thread Herbert Xu
On Wed, Mar 17, 2021 at 02:44:45PM +0530, Bhaskar Chowdhury wrote:
> 
> s/procesing/processing/
> 
> Signed-off-by: Bhaskar Chowdhury 
> ---
>  drivers/crypto/inside-secure/safexcel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v12 00/10] Add support for x509 certs with NIST P384/256/192 keys

2021-03-26 Thread Herbert Xu
le   |   6 +
>  crypto/asymmetric_keys/pkcs7_parser.c |   4 +
>  crypto/asymmetric_keys/public_key.c   |   4 +-
>  crypto/asymmetric_keys/x509_cert_parser.c |  49 ++-
>  crypto/asymmetric_keys/x509_public_key.c  |   4 +-
>  crypto/ecc.c  | 281 +-
>  crypto/ecc.h  |  28 +-
>  crypto/ecc_curve_defs.h   |  32 ++
>  crypto/ecdsa.c| 376 +++
>  crypto/ecdsasignature.asn1|   4 +
>  crypto/testmgr.c  |  18 +
>  crypto/testmgr.h  | 424 ++
>  include/crypto/ecdh.h |   1 +
>  include/keys/asymmetric-type.h|   6 +
>  include/linux/oid_registry.h  |  10 +-
>  lib/oid_registry.c|  24 ++
>  security/integrity/digsig_asymmetric.c|  30 +-
>  20 files changed, 1240 insertions(+), 107 deletions(-)
>  create mode 100644 crypto/ecdsa.c
>  create mode 100644 crypto/ecdsasignature.asn1

Patches 1-9 applied to branch ecc.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v3 0/2] PSP TEE driver update and bug fixes

2021-03-26 Thread Herbert Xu
On Mon, Mar 15, 2021 at 01:55:27PM +0530, Rijo Thomas wrote:
> The first patch helps to improve the response time by reducing the
> polling time of the tee command status variable.
> 
> Second patch is a bug fix to handle multi-threaded use-case.
> During testing, race condition was seen due to missing synchronisation
> in writes to the TEE ring buffer. This patch helps to resolve that.
> 
> v3:
>  * Fixed checkpatch.pl warning
> 
> v2:
>  * Updated copyright year as a part of code change
> 
> Rijo Thomas (2):
>   crypto: ccp - reduce tee command status polling interval from 5ms to
> 1ms
>   crypto: ccp - fix command queuing to TEE ring buffer
> 
>  drivers/crypto/ccp/tee-dev.c | 57 
>  drivers/crypto/ccp/tee-dev.h | 20 +++--
>  2 files changed, 57 insertions(+), 20 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


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

2021-03-26 Thread Herbert Xu
On Fri, Mar 19, 2021 at 03:33:07PM +0800, Yang Shen wrote:
>
> +const struct hisi_zip_sqe_ops hisi_zip_ops_v2 = {
> + .sqe_type   = 0x3,
> + .fill_addr  = hisi_zip_fill_addr,
> + .fill_buf_size  = hisi_zip_fill_buf_size,
> + .fill_buf_type  = hisi_zip_fill_buf_type,
> + .fill_req_type  = hisi_zip_fill_req_type,
> + .fill_tag   = hisi_zip_fill_tag_v2,
> + .fill_sqe_type  = hisi_zip_fill_sqe_type,
> + .get_tag= hisi_zip_get_tag_v2,
> + .get_status = hisi_zip_get_status,
> + .get_dstlen = hisi_zip_get_dstlen,
> +};
> +

This triggers a new warning:

  CHECK   ../drivers/crypto/hisilicon/zip/zip_crypto.c
  ../drivers/crypto/hisilicon/zip/zip_crypto.c:527:31: warning: symbol 
'hisi_zip_ops_v1' was not declared. Should it be static?
  ../drivers/crypto/hisilicon/zip/zip_crypto.c:540:31: warning: symbol 
'hisi_zip_ops_v2' was not declared. Should it be static?

Please fix.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [RFC 1/1] crypto: dcp - add power management support

2021-03-26 Thread Herbert Xu
On Fri, Mar 19, 2021 at 02:22:57AM +0200, Dragos Rosioru (OSS) wrote:
> From: Dragos Rosioru 
> 
> Added suspend/resume operations for PM support in the DCP driver.
> After a suspend/resume cycle DCP would still be in a low-power mode
> and have its clocks gated, thus requiring state to be saved beforehand:
> - Control register value(DCP_CTRL)
> - Channel control register value(DCP_CHANNELCTRL)
> 
> Signed-off-by: Dragos Rosioru 
> ---
>  drivers/crypto/mxs-dcp.c | 76 
> ++--
>  1 file changed, 74 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
> index d6a7784..6748a4a 100644
> --- a/drivers/crypto/mxs-dcp.c
> +++ b/drivers/crypto/mxs-dcp.c
> @@ -23,6 +23,10 @@
>  #include 
>  #include 
>  
> +#ifdef CONFIG_PM_SLEEP
> +#include 
> +#endif

Please find a way to rework this patch so that it's not full of
these ifdefs.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] include/linux: Fix typo issue

2021-03-26 Thread Herbert Xu
On Tue, Mar 16, 2021 at 11:42:13AM +0800, zuoqil...@163.com wrote:
> From: zuoqilin 
> 
> Change 'bufer' to 'buffer'.
> 
> Signed-off-by: zuoqilin 
> ---
>  include/linux/mpi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Please resend to linux-crypto.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [GIT PULL] ext4 fixes for v5.12

2021-03-22 Thread Herbert Xu
Theodore Ts'o  wrote:
> 
> From: 曹子德(Theodore Y Ts'o) 

"Yue" doesn't seem to match your second character which is usually
romanised as "Tze" in Cantonese, could it be

    曹予德

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH net-next 2/2] net: socket: change MSG_CMSG_COMPAT to BIT(21)

2021-03-21 Thread Herbert Xu
On Sun, Mar 21, 2021 at 08:39:29PM +0800, menglong8.d...@gmail.com wrote:
>
> diff --git a/include/linux/socket.h b/include/linux/socket.h
> index d5ebfe30d96b..317b2933f499 100644
> --- a/include/linux/socket.h
> +++ b/include/linux/socket.h
> @@ -312,17 +312,18 @@ struct ucred {
>* plain text and require encryption
>*/
>  
> +#if defined(CONFIG_COMPAT)
> +#define MSG_CMSG_COMPAT  BIT(21) /* This message needs 32 bit 
> fixups */
> +#else
> +#define MSG_CMSG_COMPAT  0   /* We never have 32 bit fixups 
> */
> +#endif
> +
>  #define MSG_ZEROCOPY BIT(26) /* Use user data in kernel path */
>  #define MSG_FASTOPEN BIT(29) /* Send data in TCP SYN */
>  #define MSG_CMSG_CLOEXEC BIT(30) /* Set close_on_exec for file
>* descriptor received through
>* SCM_RIGHTS
>*/
> -#if defined(CONFIG_COMPAT)
> -#define MSG_CMSG_COMPAT  BIT(31) /* This message needs 32 bit 
> fixups */
> -#else
> -#define MSG_CMSG_COMPAT  0   /* We never have 32 bit fixups 
> */
> -#endif

Shouldn't you add some comment here to stop people from trying to
use BIT(31) in the future?

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] char: hw_random: delete redundant printing of return value

2021-03-19 Thread Herbert Xu
On Sat, Mar 13, 2021 at 03:47:42PM +0800, Wang Qing wrote:
> platform_get_irq() has already checked and printed the return value, 
> the printing here is nothing special, it is not necessary at all.
> 
> Signed-off-by: Wang Qing 
> ---
>  drivers/char/hw_random/cctrng.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v4 0/3] crypto:hisilicon/sec - fixes some coding style

2021-03-19 Thread Herbert Xu
On Sat, Mar 13, 2021 at 03:28:22PM +0800, Longfang Liu wrote:
> 1. Fix a problems.
> 2. Fix some coding style.
> 
> Changes v3 -> v4:
>   - Fixed an unused warning on dev.
>   - Create a patch for bugfix
> 
> Changes v2 -> v3:
>   - Delete shash test error patch.
> 
> Changes v1 -> v2:
>   - Modify the way to fix shash test error.
> 
> Longfang Liu (3):
>   crypto: hisilicon/sec - fixes a printing error
>   crypto: hisilicon/sec - fixes some coding style
>   crypto: hisilicon/sec - fixes some driver coding style
> 
>  drivers/crypto/hisilicon/sec2/sec.h|   5 +-
>  drivers/crypto/hisilicon/sec2/sec_crypto.c |  77 +
>  drivers/crypto/hisilicon/sec2/sec_crypto.h |   2 -
>  drivers/crypto/hisilicon/sec2/sec_main.c   | 131 
> +
>  4 files changed, 116 insertions(+), 99 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [kbuild-all] Re: [PATCH] gcov: fail build on gcov_info size mismatch

2021-03-16 Thread Herbert Xu
Linus Torvalds  wrote:
>
> See:
> 
>   [torvalds@ryzen ~]$ a="!" [ "$a" = ".size" ]
> 
> is fine, but
> 
>   [torvalds@ryzen ~]$ a="!" [ $a = ".size" ]
>   -bash: [: =: unary operator expected

This isn't doing what you think it's doing.  The first assignment
to a is not in effect when the shell is expanding $a so what you're
actually running is

a="!" [ = .size ]

Which is why it bombs out.

To get the desired result you need a semicolon:

$ a="!"; [ $a = ".size" ]
$ 

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [kbuild-all] Re: [PATCH] gcov: fail build on gcov_info size mismatch

2021-03-15 Thread Herbert Xu
On Mon, Mar 15, 2021 at 01:57:58PM -0700, Linus Torvalds wrote:
>
> $ [ "!"  = ".size" -a "b" = ".LPBX0," ]
> 
> causes
> 
> dash: 6: [: =: unexpected operator
> 
> because for some reason that "-a" ends up (wild handwaving here about
> what is going on) re-parsing the first expression, and ignoring the
> quoting around "!" when it does so.

The quoting on "!" doesn't help I'm afraid.  Even though [ is a
built-in it is not allowed to look at the quoting because it's
supposed to behave in the same way whether you get the builtin [
or the one from /usr/bin.

So when it gets the expression the quoting on the "!" has already
been removed.

IOW this expression is ambiguous and may or may not fail depending
on how it's parsed.

Note that when you have a simple expression like

[ "!" = ".size" ]

special rules come into play on how it is parsed:

https://pubs.opengroup.org/onlinepubs/009604499/utilities/test.html

But this does not apply when you construct more complex ones with
-a.

There are two ways around this when writing scripts, you either
add something to ensure that "!" cannot occur, e.g.,

[ "X$a" = "X$b" -a ... ]

or you break it down into a simpler expression that is guaranteed
by POSIX:

[ "$a" = "$b" ] && [ ... ]

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v6 0/3] hwrng: bcm2835: add reset support

2021-03-12 Thread Herbert Xu
On Fri, Mar 05, 2021 at 08:01:29AM +0100, Álvaro Fernández Rojas wrote:
> Some devices may need to perform a reset before using the RNG, such as the
> BCM6368.
> 
> v6: fix dt-bindings documentation, add patch makings clocks mandatory for
>  BCM6368.
> v5: remove reset_control_rearm() and apply on latest 
> herbert/cryptodev-2.6.git.
> v4: fix documentation, add reset_control_rearm().
> v3: make resets required if brcm,bcm6368-rng.
> v2: document reset support.
> 
> Álvaro Fernández Rojas (3):
>   dt-bindings: rng: bcm2835: add clock constraints
>   dt-bindings: rng: bcm2835: document reset support
>   hwrng: bcm2835: add reset support
> 
>  .../devicetree/bindings/rng/brcm,bcm2835.yaml | 21 +++
>  drivers/char/hw_random/bcm2835-rng.c  | 10 +
>  2 files changed, 31 insertions(+)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v2 0/2] crypto: qat - fixes related to 'dma_map_single'

2021-03-12 Thread Herbert Xu
On Fri, Mar 05, 2021 at 02:35:00PM +0800, Hui Tang wrote:
> This patchset fix bugs related to 'dma_map_single' use:
> 
> Hui Tang (2):
>   crypto: qat - fix 'dma_unmap_single' invalid address
>   crypto: qat - fix use of 'dma_map_single'
> 
> 
> v1 -> v2:
>   1.fix build warning reported by kernel test rebot
>   2.add patch #1
> 
>  drivers/crypto/qat/qat_common/qat_algs.c | 32 
> 
>  1 file changed, 20 insertions(+), 12 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v10 0/7] add ECDH and CURVE25519 algorithms support for Kunpeng 930

2021-03-12 Thread Herbert Xu
On Thu, Mar 04, 2021 at 02:35:43PM +0800, Meng Yu wrote:
> 1. Move  curve ID from the key into the algorithm name (like 'ecdh-nist-pxxx'
>so we get its tfm like 'crypto_alloc_kpp("ecdh-nist-p256", 0, 0)'),
>in 'crypto/ecc.c' (has been verified by testmgr) and 'crypto/atmel-ecc.c'
>(only compiled, not do test), and modify 'testmgr.c' and 
> 'net/bluetooth/smp.c'
>(only compiled, not do test) to adapt the modification;
> 
> 2. Add new file 'include/crypto/ecc_curve.h', and move 'struct ecc_point' and
>'struct ecc_curve' definitions to it, also add new APIs 'ecc_get_curveXXX'
>into it, with these APIs, users in kernel tree can get ECDH and
>curve25519 parameters;
> 
> 3. Add ECDH and CURVE25519 algorithms support for Kunpeng 930.
> 
> v9->v10:
> - patch #3: delete 'atmel_ecdh_supported_curve' and 'n_sz' in atmel-ecc.c
> 
> v8->v9:
> - patch #3: squash patches 3-5 in v8 into one in v9
> - patch #4: delete ECDH curve parameters: P224, P384 and P521
> - patch #5: delete ecdh-nist-p224, ecdh-nist-p384 and ecdh-nist-p521 support 
> in HPRE
> 
> v7->v8:
> - patch #3 and #5: move the curve ID from the key into the algorithm name 
> instead
> 
> v6->v7:
> - patch #4: add function interface to expose elliptic curve parameters
> - patch #4: eliminate warning by 'kernel test robot'
> - patch #5: add function interface to expose curve25519 parameters
> 
> v5->v6:
> - patch #1: add a new patch (the first patch), which is the "depend on" patch 
> before
> 
> v4->v5:
> - patch #4: delete P-128 and P-320 curve, as the few using case in the kernel
> 
> v3 -> v4:
> - patch #3: add new, and move ecc_curve params to "include/crypto"
> 
> v2 -> v3:
> - patch #5: fix sparse warnings
> - patch #5: add 'CRYPTO_LIB_CURVE25519_GENERIC' in 'Kconfig'
> 
> v1 -> v2:
> - patch #5: delete `curve25519_null_point'
> 
> 
> Meng Yu (7):
>   crypto: hisilicon/hpre - add version adapt to new algorithms
>   crypto: hisilicon/hpre - add algorithm type
>   crypto: move curve_id of ECDH from the key to algorithm name
>   crypto: and expose ecc curves
>   crypto: hisilicon/hpre - add 'ECDH' algorithm
>   crypto: add curve25519 params and expose them
>   crypto: hisilicon/hpre - add 'CURVE25519' algorithm
> 
>  crypto/ecc.c|  11 +-
>  crypto/ecc.h|  37 +-
>  crypto/ecc_curve_defs.h |  17 +
>  crypto/ecdh.c   |  72 ++-
>  crypto/ecdh_helper.c|   4 +-
>  crypto/testmgr.c|  13 +-
>  crypto/testmgr.h|  34 +-
>  drivers/crypto/atmel-ecc.c  |  28 +-
>  drivers/crypto/hisilicon/Kconfig|   1 +
>  drivers/crypto/hisilicon/hpre/hpre.h|  17 +-
>  drivers/crypto/hisilicon/hpre/hpre_crypto.c | 881 
> +++-
>  drivers/crypto/hisilicon/hpre/hpre_main.c   |  12 +-
>  drivers/crypto/hisilicon/qm.c   |   4 +-
>  drivers/crypto/hisilicon/qm.h   |   4 +-
>  drivers/crypto/hisilicon/sec2/sec.h |   4 +-
>  drivers/crypto/hisilicon/sec2/sec_crypto.c  |   4 +-
>  drivers/crypto/hisilicon/sec2/sec_crypto.h  |   4 +-
>  drivers/crypto/hisilicon/zip/zip.h  |   4 +-
>  drivers/crypto/hisilicon/zip/zip_crypto.c   |   4 +-
>  include/crypto/ecc_curve.h  |  60 ++
>  include/crypto/ecdh.h   |   2 -
>  net/bluetooth/ecdh_helper.c |   2 -
>  net/bluetooth/selftest.c|   2 +-
>  net/bluetooth/smp.c |   6 +-
>  24 files changed, 1086 insertions(+), 141 deletions(-)
>  create mode 100644 include/crypto/ecc_curve.h

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: allwinner: sun8i-ce: fix error return code in sun8i_ce_prng_generate()

2021-03-12 Thread Herbert Xu
On Thu, Mar 04, 2021 at 05:57:17PM -0800, Jia-Ju Bai wrote:
> When dma_mapping_error() returns an error, no error return code of 
> sun8i_ce_prng_generate() is assigned.
> To fix this bug, err is assigned with -EFAULT as error return code.
> 
> Reported-by: TOTE Robot 
> Signed-off-by: Jia-Ju Bai 
> ---
>  drivers/crypto/allwinner/sun8i-ce/sun8i-ce-prng.c | 1 +
>  1 file changed, 1 insertion(+)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: ccp - Don't initialize SEV support without the SEV feature

2021-03-12 Thread Herbert Xu
On Wed, Mar 03, 2021 at 04:31:09PM -0600, Tom Lendacky wrote:
> From: Tom Lendacky 
> 
> If SEV has been disabled (e.g. through BIOS), the driver probe will still
> issue SEV firmware commands. The SEV INIT firmware command will return an
> error in this situation, but the error code is a general error code that
> doesn't highlight the exact reason.
> 
> Add a check for X86_FEATURE_SEV in sev_dev_init() and emit a meaningful
> message and skip attempting to initialize the SEV firmware if the feature
> is not enabled. Since building the SEV code is dependent on X86_64, adding
> the check won't cause any build problems.
> 
> Cc: John Allen 
> Cc: Brijesh Singh 
> Signed-off-by: Tom Lendacky 
> ---
>  drivers/crypto/ccp/sev-dev.c | 6 ++
>  1 file changed, 6 insertions(+)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: sun8i-ss: Fix memory leak of object d when dma_iv fails to map

2021-03-12 Thread Herbert Xu
On Tue, Mar 02, 2021 at 04:34:46PM +, Colin King wrote:
> From: Colin Ian King 
> 
> In the case where the dma_iv mapping fails, the return error path leaks
> the memory allocated to object d.  Fix this by adding a new error return
> label and jumping to this to ensure d is free'd before the return.
> 
> Addresses-Coverity: ("Resource leak")
> Fixes: ac2614d721de ("crypto: sun8i-ss - Add support for the PRNG")
> Signed-off-by: Colin Ian King 
> ---
>  drivers/crypto/allwinner/sun8i-ss/sun8i-ss-prng.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] include/linux: Fix typo issue

2021-03-12 Thread Herbert Xu
On Tue, Mar 02, 2021 at 07:34:33PM +0800, zuoqil...@163.com wrote:
> From: zuoqilin 
> 
> Change 'bufer' to 'buffer'.
> 
> Signed-off-by: zuoqilin 
> ---
>  include/linux/mpi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Please resend to linux-cry...@vger.kernel.org.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 0/7] Add support for AEAD algorithms in Qualcomm Crypto Engine driver

2021-03-12 Thread Herbert Xu
On Thu, Mar 04, 2021 at 01:41:15PM -0500, Thara Gopinath wrote:
>
> Yes it did. The last patch adds fallback for unsupported cases and
> this will make it pass the fuzz tests.

Please include this information in the next round.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 4/7] crypto: qce: Add support for AEAD algorithms

2021-03-12 Thread Herbert Xu
On Thu, Feb 25, 2021 at 01:27:13PM -0500, Thara Gopinath wrote:
>
> +static int
> +qce_aead_async_req_handle(struct crypto_async_request *async_req)
> +{
> + struct aead_request *req = aead_request_cast(async_req);
> + struct qce_aead_reqctx *rctx = aead_request_ctx(req);
> + struct crypto_aead *tfm = crypto_aead_reqtfm(req);
> + struct qce_aead_ctx *ctx = crypto_tfm_ctx(async_req->tfm);
> + struct qce_alg_template *tmpl = to_aead_tmpl(crypto_aead_reqtfm(req));
> + struct qce_device *qce = tmpl->qce;
> + enum dma_data_direction dir_src, dir_dst;
> + unsigned int totallen;
> + bool diff_dst;
> + int ret;
> +
> + if (IS_CCM_RFC4309(rctx->flags)) {
> + memset(rctx->ccm_rfc4309_iv, 0, QCE_MAX_IV_SIZE);
> + rctx->ccm_rfc4309_iv[0] = 3;
> + memcpy(>ccm_rfc4309_iv[1], ctx->ccm4309_salt, 
> QCE_CCM4309_SALT_SIZE);
> + memcpy(>ccm_rfc4309_iv[4], req->iv, 8);
> + rctx->iv = rctx->ccm_rfc4309_iv;
> + rctx->ivsize = AES_BLOCK_SIZE;
> + } else {
> + rctx->iv = req->iv;
> + rctx->ivsize = crypto_aead_ivsize(tfm);
> + }
> + if (IS_CCM_RFC4309(rctx->flags))
> + rctx->assoclen = req->assoclen - 8;
> + else
> + rctx->assoclen = req->assoclen;
> +
> + totallen = rctx->cryptlen + rctx->assoclen;

This triggers a warning on totallen not being used.  Please fix.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v3 1/2] crypto: hisilicon/sec - fixes some log printing style

2021-03-12 Thread Herbert Xu
On Thu, Mar 04, 2021 at 02:18:54PM +0800, Longfang Liu wrote:
>
> @@ -727,7 +725,7 @@ static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, 
> struct sec_req *req,
>   struct aead_request *aead_req = req->aead_req.aead_req;
>   struct sec_cipher_req *c_req = >c_req;
>   struct sec_qp_ctx *qp_ctx = req->qp_ctx;
> - struct device *dev = SEC_CTX_DEV(ctx);
> + struct device *dev = ctx->dev;
>   int copy_size, pbuf_length;
>   int req_id = req->req_id;
>  
> @@ -737,11 +735,9 @@ static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, 
> struct sec_req *req,
>   copy_size = c_req->c_len;
>  
>   pbuf_length = sg_copy_from_buffer(dst, sg_nents(dst),
> - qp_ctx->res[req_id].pbuf,
> - copy_size);
> -
> + qp_ctx->res[req_id].pbuf, copy_size);
>   if (unlikely(pbuf_length != copy_size))
> - dev_err(dev, "copy pbuf data to dst error!\n");
> + dev_err(ctx->dev, "copy pbuf data to dst error!\n");
>  }

This triggers an unused warning on dev.  Please fix.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: sun8i-ss: fix result memory leak on error path

2021-03-12 Thread Herbert Xu
On Tue, Mar 02, 2021 at 05:41:45PM +0100, Corentin Labbe wrote:
> This patch fixes a memory leak on an error path.
> 
> Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms")
> Reported-by: kernel test robot 
> Reported-by: Dan Carpenter 
> Signed-off-by: Corentin Labbe 
> ---
>  drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This patch was already merged a month ago:

commit 1dbc6a1e25be8575d6c4114d1d2b841a796507f7
Author: Corentin Labbe 
Date:   Fri Feb 12 09:46:10 2021 +0100

crypto: sun8i-ss - fix result memory leak on error path

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


[PATCH] crypto: aegis128 - Move simd prototypes into aegis.h

2021-03-07 Thread Herbert Xu
On Sun, Feb 28, 2021 at 03:14:55AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   5695e51619745d4fe3ec2506a2f0cd982c5e27a4
> commit: a4397635afea5d127548d64e0055ed471ef2d5be crypto: aegis128 - provide a 
> SIMD implementation based on NEON intrinsics
> date:   1 year, 6 months ago
> config: arm64-randconfig-r035-20210226 (attached as .config)
> compiler: aarch64-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a4397635afea5d127548d64e0055ed471ef2d5be
> git remote add linus 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout a4397635afea5d127548d64e0055ed471ef2d5be
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
> ARCH=arm64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot 
> 
> All warnings (new ones prefixed by >>):
> 
> >> crypto/aegis128-neon.c:17:6: warning: no previous prototype for 
> >> 'crypto_aegis128_have_simd' [-Wmissing-prototypes]
>   17 | bool crypto_aegis128_have_simd(void)
>  |  ^

---8<---
This patch fixes missing prototype warnings in crypto/aegis128-neon.c.

Fixes: a4397635afea ("crypto: aegis128 - provide a SIMD...")
Reported-by: kernel test robot 
Signed-off-by: Herbert Xu 

diff --git a/crypto/aegis.h b/crypto/aegis.h
index 6920ebe77679..6ef9c174c973 100644
--- a/crypto/aegis.h
+++ b/crypto/aegis.h
@@ -21,9 +21,28 @@ union aegis_block {
u8 bytes[AEGIS_BLOCK_SIZE];
 };
 
+struct aegis_state;
+
+extern int aegis128_have_aes_insn;
+
 #define AEGIS_BLOCK_ALIGN (__alignof__(union aegis_block))
 #define AEGIS_ALIGNED(p) IS_ALIGNED((uintptr_t)p, AEGIS_BLOCK_ALIGN)
 
+bool crypto_aegis128_have_simd(void);
+void crypto_aegis128_update_simd(struct aegis_state *state, const void *msg);
+void crypto_aegis128_init_simd(struct aegis_state *state,
+  const union aegis_block *key,
+  const u8 *iv);
+void crypto_aegis128_encrypt_chunk_simd(struct aegis_state *state, u8 *dst,
+   const u8 *src, unsigned int size);
+void crypto_aegis128_decrypt_chunk_simd(struct aegis_state *state, u8 *dst,
+   const u8 *src, unsigned int size);
+int crypto_aegis128_final_simd(struct aegis_state *state,
+  union aegis_block *tag_xor,
+  unsigned int assoclen,
+  unsigned int cryptlen,
+  unsigned int authsize);
+
 static __always_inline void crypto_aegis_block_xor(union aegis_block *dst,
   const union aegis_block *src)
 {
diff --git a/crypto/aegis128-core.c b/crypto/aegis128-core.c
index 89dc1c559689..c4f1bfa1d04f 100644
--- a/crypto/aegis128-core.c
+++ b/crypto/aegis128-core.c
@@ -58,21 +58,6 @@ static bool aegis128_do_simd(void)
return false;
 }
 
-bool crypto_aegis128_have_simd(void);
-void crypto_aegis128_update_simd(struct aegis_state *state, const void *msg);
-void crypto_aegis128_init_simd(struct aegis_state *state,
-  const union aegis_block *key,
-  const u8 *iv);
-void crypto_aegis128_encrypt_chunk_simd(struct aegis_state *state, u8 *dst,
-   const u8 *src, unsigned int size);
-void crypto_aegis128_decrypt_chunk_simd(struct aegis_state *state, u8 *dst,
-   const u8 *src, unsigned int size);
-int crypto_aegis128_final_simd(struct aegis_state *state,
-  union aegis_block *tag_xor,
-  unsigned int assoclen,
-  unsigned int cryptlen,
-  unsigned int authsize);
-
 static void crypto_aegis128_update(struct aegis_state *state)
 {
union aegis_block tmp;
diff --git a/crypto/aegis128-neon.c b/crypto/aegis128-neon.c
index 94d591a002a4..a7856915ec85 100644
--- a/crypto/aegis128-neon.c
+++ b/crypto/aegis128-neon.c
@@ -30,7 +30,7 @@ bool crypto_aegis128_have_simd(void)
return IS_ENABLED(CONFIG_ARM64);
 }
 
-void crypto_aegis128_init_simd(union aegis_block *state,
+void crypto_aegis128_init_simd(struct aegis_state *state,
   const union aegis_block *key,
   const u8 *iv)
 {
@@ -39,14 +39,14 @@ v

Re: [PATCH v9 6/9] crypto: Add NIST P384 curve parameters

2021-03-04 Thread Herbert Xu
On Thu, Mar 04, 2021 at 08:59:36AM -0500, Stefan Berger wrote:
>
> Are you going to take the other patches as well, except for maybe 9/9, which
> depends on Nayan's patch series. Mimi suggested to me to ask you whether you
> could create a topic branch where we can apply other patches to, such as
> Nayna's?

Yes I can do a topic branch.  Please let me know which patches
I should take when you resubmit.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v2] crypto/nx: add missing call to of_node_put()

2021-03-03 Thread Herbert Xu
On Fri, Feb 26, 2021 at 09:23:06AM +0800, Yang Li wrote:
> In one of the error paths of the for_each_child_of_node() loop,
> add missing call to of_node_put().
> 
> Fix the following coccicheck warning:
> ./drivers/crypto/nx/nx-common-powernv.c:927:1-23: WARNING: Function
> "for_each_child_of_node" should have of_node_put() before return around
> line 936.
> 
> Reported-by: Abaci Robot 
> Signed-off-by: Yang Li 
> ---
> 
> Changes in v2:
> -add braces for if
> 
>  drivers/crypto/nx/nx-common-powernv.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: testmgr - delete some redundant code

2021-03-03 Thread Herbert Xu
On Tue, Feb 23, 2021 at 11:42:04AM +0800, Kai Ye wrote:
> Delete sg_data function, because sg_data function definition same as
> sg_virt(), so need to delete it and use sg_virt() replace to sg_data().
> 
> Signed-off-by: Kai Ye 
> ---
>  crypto/testmgr.c | 11 +++
>  1 file changed, 3 insertions(+), 8 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [RFT PATCH] crypto: s5p-sss - initialize APB clock after the AXI bus clock for SlimSSS

2021-03-03 Thread Herbert Xu
On Fri, Feb 12, 2021 at 05:35:26PM +0100, Krzysztof Kozlowski wrote:
> The driver for Slim Security Subsystem (SlimSSS) on Exynos5433 takes two
> clocks - aclk (AXI/AHB clock) and pclk (APB/Advanced Peripheral Bus
> clock).  The "aclk", as main high speed bus clock, is enabled first.  Then
> the "pclk" is enabled.
> 
> However the driver assigned reversed names for lookup of these clocks
> from devicetree, so effectively the "pclk" was enabled first.
> 
> Although it might not matter in reality, the correct order is to enable
> first main/high speed bus clock - "aclk".  Also this was the intention
> of the actual code.
> 
> Signed-off-by: Krzysztof Kozlowski 
> 
> ---
> 
> Not tested, please kindly test on Exynos5433 hardware.
> ---
>  drivers/crypto/s5p-sss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: sun8i-ss: fix result memory leak on error path

2021-03-03 Thread Herbert Xu
On Fri, Feb 12, 2021 at 09:46:10AM +0100, Corentin Labbe wrote:
> This patch fixes a memory leak on an error path.
> 
> Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms")
> Reported-by: kernel test robot 
> Reported-by: Dan Carpenter 
> Signed-off-by: Corentin Labbe 
> ---
>  drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v7 00/11] Regression fixes/clean ups in the Qualcomm crypto engine driver

2021-03-03 Thread Herbert Xu
On Thu, Feb 11, 2021 at 03:01:17PM -0500, Thara Gopinath wrote:
> This patch series is a result of running kernel crypto fuzz tests (by
> enabling CONFIG_CRYPTO_MANAGER_EXTRA_TESTS) on the transformations
> currently supported via the Qualcomm crypto engine on sdm845.  The first
> nine patches are fixes for various regressions found during testing. The
> last two patches are minor clean ups of unused variable and parameters.
> 
> v6->v7:
>   - Fixed sparse warning in patch 4 as pointed out by Herbert Xu.
> This means the checking if any two keys are same for triple
> des algorithms has been reverted back to using conditional OR
> instead of using bitwise OR.
>   - Rebased to 5.11-rc7.
> 
> v5->v6:
>   - Return 0 for zero length messages instead of -EOPNOTSUPP in the
> cipher algorithms as pointed out by Eric Biggers.
>   - Remove the wrong TODO in patch 6 which implied that AES CBC can
> do partial block sizes when it is actually CTS mode that can as
> pointed out my Eric Biggers.
> 
> v4->v5:
>   - Fixed build warning/error in patch for wrong assignment of const
> pointer as reported by kernel test robot .
>   - Rebased to 5.11-rc6.
> v3->v4:
>   - Fixed the bug where only two bytes of byte_count were getting
> saved and restored instead of all eight bytes. Thanks Bjorn for
> catching this.
>   - Split patch 3 "Fix regressions found during fuzz testing" into
> 6 patches as requested by Bjorn.
>   - Dropped crypto from all subject headers.
>   - Rebased to 5.11-rc5
> v2->v3:
> - Made the comparison between keys to check if any two keys are
>   same for triple des algorithms constant-time as per
>   Nym Seddon's suggestion.
> - Rebased to 5.11-rc4.
> v1->v2:
> - Introduced custom struct qce_sha_saved_state to store and restore
>   partial sha transformation.
> - Rebased to 5.11-rc3.
> 
> Thara Gopinath (11):
>   crypto: qce: sha: Restore/save ahash state with custom struct in
> export/import
>   crypto: qce: sha: Hold back a block of data to be transferred as part
> of final
>   crypto: qce: skcipher: Return unsupported if key1 and key 2 are same
> for AES XTS algorithm
>   crypto: qce: skcipher: Return unsupported if any three keys are same
> for DES3 algorithms
>   crypto: qce: skcipher: Return error for zero length messages
>   crypto: qce: skcipher: Return error for non-blocksize data(ECB/CBC
> algorithms)
>   crypto: qce: skcipher: Set ivsize to 0 for ecb(aes)
> *** BLURB HERE ***
> 
> Thara Gopinath (11):
>   crypto: qce: sha: Restore/save ahash state with custom struct in
> export/import
>   crypto: qce: sha: Hold back a block of data to be transferred as part
> of final
>   crypto: qce: skcipher: Return unsupported if key1 and key 2 are same
> for AES XTS algorithm
>   crypto: qce: skcipher: Return unsupported if any three keys are same
> for DES3 algorithms
>   crypto: qce: skcipher: Return error for zero length messages
>   crypto: qce: skcipher: Return error for non-blocksize data(ECB/CBC
> algorithms)
>   crypto: qce: skcipher: Set ivsize to 0 for ecb(aes)
>   crypto: qce: skcipher: Improve the conditions for requesting AES
> fallback cipher
>   crypto: qce: common: Set data unit size to message length for AES XTS
> transformation
>   crypto: qce: Remover src_tbl from qce_cipher_reqctx
>   crypto: qce: Remove totallen and offset in qce_start
> 
>  drivers/crypto/qce/cipher.h   |   1 -
>  drivers/crypto/qce/common.c   |  25 +++---
>  drivers/crypto/qce/common.h   |   3 +-
>  drivers/crypto/qce/sha.c  | 143 +-
>  drivers/crypto/qce/skcipher.c |  69 +---
>  5 files changed, 126 insertions(+), 115 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: amlogic - Fix unnecessary check in meson_crypto_probe()

2021-03-03 Thread Herbert Xu
On Wed, Feb 10, 2021 at 11:16:37AM +0800, Tang Bin wrote:
> The function meson_crypto_probe() is only called with an openfirmware
> platform device. Therefore there is no need to check that the passed
> in device is NULL.
> 
> Signed-off-by: Tang Bin 
> ---
>  drivers/crypto/amlogic/amlogic-gxl-core.c | 3 ---
>  1 file changed, 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: sha: remove unneeded semicolon

2021-03-03 Thread Herbert Xu
On Mon, Feb 08, 2021 at 05:10:38PM +0800, Yang Li wrote:
> Eliminate the following coccicheck warning:
> ./arch/powerpc/crypto/sha1-spe-glue.c:110:2-3: Unneeded semicolon
> 
> Reported-by: Abaci Robot 
> Signed-off-by: Yang Li 
> ---
>  arch/powerpc/crypto/sha1-spe-glue.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 3/3] crypto: hisilicon/sec - fixes shash test error

2021-03-03 Thread Herbert Xu
On Sat, Feb 20, 2021 at 05:51:22PM +0800, liulongfang wrote:
.
> Since patch3 is an unnecessary patch,
> can you just remove it and merge patch1 and patch2?

Please repost.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 0/7] Add support for AEAD algorithms in Qualcomm Crypto Engine driver

2021-03-03 Thread Herbert Xu
On Thu, Feb 25, 2021 at 01:27:09PM -0500, Thara Gopinath wrote:
> Enable support for AEAD algorithms in Qualcomm CE driver.  The first three
> patches in this series are cleanups and add a few missing pieces required
> to add support for AEAD algorithms.  Patch 4 introduces supported AEAD
> transformations on Qualcomm CE.  Patches 5 and 6 implements the h/w
> infrastructure needed to enable and run the AEAD transformations on
> Qualcomm CE.  Patch 7 adds support to queue fallback algorithms in case of
> unsupported special inputs.
> 
> This series is dependant on https://lkml.org/lkml/2021/2/11/1052.

Did this patch series pass the fuzz tests?

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH v9 6/9] crypto: Add NIST P384 curve parameters

2021-03-03 Thread Herbert Xu
On Thu, Feb 25, 2021 at 11:07:59AM -0500, Stefan Berger wrote:
> From: Saulo Alessandre 
> 
> * crypto/ecc_curve_defs.h
>   - add nist_p384 params
> 
> * include/crypto/ecdh.h
>   - add ECC_CURVE_NIST_P384
> 
> Signed-off-by: Saulo Alessandre 
> Tested-by: Stefan Berger 
> ---
>  crypto/ecc_curve_defs.h | 32 
>  include/crypto/ecdh.h   |  1 +
>  2 files changed, 33 insertions(+)

Can you reorder the patches so that the crypto patches come first
and then I can apply them?

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH 02/20] crypto: Manual replacement of the deprecated strlcpy() with return values

2021-03-03 Thread Herbert Xu
On Mon, Feb 22, 2021 at 04:12:13PM +0100, Romain Perier wrote:
>
> diff --git a/crypto/lrw.c b/crypto/lrw.c
> index bcf09fbc750a..4d35f4439012 100644
> --- a/crypto/lrw.c
> +++ b/crypto/lrw.c
> @@ -357,10 +357,10 @@ static int lrw_create(struct crypto_template *tmpl, 
> struct rtattr **tb)
>* cipher name.
>*/
>   if (!strncmp(cipher_name, "ecb(", 4)) {
> - unsigned len;
> + ssize_t len;
>  
> - len = strlcpy(ecb_name, cipher_name + 4, sizeof(ecb_name));
> - if (len < 2 || len >= sizeof(ecb_name))
> + len = strscpy(ecb_name, cipher_name + 4, sizeof(ecb_name));
> + if (len == -E2BIG || len < 2)

len == -E2BIG is superfluous as len < 2 will catch it anyway.

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: [PATCH] crypto: mediatek - remove obsolete documentation

2021-03-03 Thread Herbert Xu
On Wed, Mar 03, 2021 at 04:09:23PM +0800, Vic Wu wrote:
> The crypto mediatek driver has been replaced by the inside-secure driver now.
> Remove DT bindings documentation and update crypto engine nodes to the 
> mt7623.dtsi files.
> 
> Signed-off-by: Vic Wu 
> Acked-by: Ryder Lee 
> ---
>  Documentation/devicetree/bindings/crypto/mediatek-crypto.txt   | 25 
> ---
>  arch/arm/boot/dts/mt7623.dtsi |  8 +++---
>  2 files changed, 3 insertions(+), 30 deletions(-)
>  delete mode 100644 
> Documentation/devicetree/bindings/crypto/mediatek-crypto.txt

Shouldn't this go through Matthias Brugger ?

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


  1   2   3   4   5   6   7   8   9   10   >