Re: [PATCH 2/2] crypto: ccree - add custom cache params from DT file

2020-09-17 Thread Gilad Ben-Yossef
hmm... On Wed, Sep 16, 2020 at 4:48 PM kernel test robot wrote: > > url: > https://github.com/0day-ci/linux/commits/Gilad-Ben-Yossef/add-optional-cache-params-from-DT/20200916-152151 > base: > https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git > master > config: arm

[PATCH -next] crypto: marvell/cesa - use devm_platform_ioremap_resource_byname

2020-09-17 Thread Qilong Zhang
From: Zhang Qilong Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately. Signed-off-by: Zhang Qilong --- drivers/crypto/marvell/cesa/cesa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

Re: [PATCH] random: use correct memory barriers for crng_node_pool

2020-09-17 Thread Herbert Xu
Eric Biggers wrote: > From: Eric Biggers > > When a CPU selects which CRNG to use, it accesses crng_node_pool without > a memory barrier. That's wrong, because crng_node_pool can be set by > another CPU concurrently. Without a memory barrier, the crng_state that > is used might not appear to b

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

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

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

2020-09-17 Thread Herbert Xu
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. >

Re: [PATCH 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Christoph Hellwig
On Wed, Sep 16, 2020 at 09:35:51PM -0400, Rik van Riel wrote: > > One possibility is to have a kernel wrapper on top of the zstd API to > > make it > > more ergonomic. I personally don???t really see the value in it, since > > it adds > > another layer of indirection between zstd and the caller, bu

[PATCH v3,net-next,2/4] octeontx2-af: add support to manage the CPT unit

2020-09-17 Thread Srujana Challa
From: Srujana The Admin function (AF) manages hardware resources on the cryptographic acceleration unit(CPT). This patch adds a mailbox interface for PFs and VFs to configure hardware resources for cryptography and inline-ipsec. Signed-off-by: Suheil Chandran Signed-off-by: Vidya Sagar Velumuri

[PATCH v3,net-next,0/4] Add Support for Marvell OcteonTX2 Cryptographic

2020-09-17 Thread Srujana Challa
The following series adds support for Marvell Cryptographic Acceleration Unit(CPT) on OcteonTX2 CN96XX SoC. This series is tested with CRYPTO_EXTRA_TESTS enabled and CRYPTO_DISABLE_TESTS disabled. Changes since v2: * Fixed C=1 warnings. * Added code to exit CPT VF driver gracefully. * Moved Oct

[PATCH v3,net-next,1/4] octeontx2-pf: move asm code to include/linux/soc

2020-09-17 Thread Srujana Challa
On OcteonTX2 platform CPT instruction enqueue and NIX packet send are only possible via LMTST operations which uses LDEOR instruction. This patch moves the asm code from OcteonTX2 nic driver to include/linux/soc as it will be used by OcteonTX2 CPT and NIC driver for LMTST. Signed-off-by: Srujana C

Re: [PATCH 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Chris Mason
On 17 Sep 2020, at 6:04, Christoph Hellwig wrote: On Wed, Sep 16, 2020 at 09:35:51PM -0400, Rik van Riel wrote: One possibility is to have a kernel wrapper on top of the zstd API to make it more ergonomic. I personally don???t really see the value in it, since it adds another layer of indire

[PATCH v3,net-next,4/4] drivers: crypto: add the Virtual Function driver for OcteonTX2 CPT

2020-09-17 Thread Srujana Challa
Add support for the cryptographic accelerator unit virtual functions on OcteonTX2 96XX SoC. Signed-off-by: Suheil Chandran Signed-off-by: Lukas Bartosik Signed-off-by: Srujana Challa --- drivers/crypto/marvell/Kconfig|4 + drivers/crypto/marvell/octeontx2/Makefile |

Re: [PATCH] random: use correct memory barriers for crng_node_pool

2020-09-17 Thread Eric Biggers
On Thu, Sep 17, 2020 at 05:26:44PM +1000, Herbert Xu wrote: > Eric Biggers wrote: > > From: Eric Biggers > > > > When a CPU selects which CRNG to use, it accesses crng_node_pool without > > a memory barrier. That's wrong, because crng_node_pool can be set by > > another CPU concurrently. Witho

Re: [PATCH 1/9] lib: zstd: Add zstd compatibility wrapper

2020-09-17 Thread Nick Terrell
> On Sep 16, 2020, at 1:48 AM, Christoph Hellwig wrote: > > On Tue, Sep 15, 2020 at 08:42:54PM -0700, Nick Terrell wrote: >> From: Nick Terrell >> >> Adds zstd_compat.h which provides the necessary functions from the >> current zstd.h API. It is only active for zstd versions 1.4.6 and newer.

[PATCH 7/7] crypto: sun4i-ss: add SPDX header and remove blank lines

2020-09-17 Thread Corentin Labbe
This patchs fixes some remaining style issue. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c | 3 --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-prng.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/crypto/allwinner/sun4i-ss/

[PATCH 5/7] crypto: sun4i-ss: initialize need_fallback

2020-09-17 Thread Corentin Labbe
The need_fallback is never initialized and seem to be always true at runtime. So all hardware operations are always bypassed. Fixes: 0ae1f46c55f87 ("crypto: sun4i-ss - fallback when length is not multiple of blocksize") Cc: Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/su

[PATCH 1/7] crypto: sun4i-ss: linearize buffers content must be kept

2020-09-17 Thread Corentin Labbe
When running the non-optimized cipher function, SS produce partial random output. This is due to linearize buffers being reseted after each loop. Fixes: 8d3bcb9900ca ("crypto: sun4i-ss - reduce stack usage") Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c |

[PATCH 4/7] crypto: sun4i-ss: handle BigEndian for cipher

2020-09-17 Thread Corentin Labbe
Ciphers produce invalid results on BE. Key and IV need to be written in LE. Furthermore, the non-optimized function is too complicated to convert, let's simply fallback on BE for the moment. Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator") Cc: Signed-o

[PATCH 6/7] crypto: sun4i-ss: enabled stats via debugfs

2020-09-17 Thread Corentin Labbe
This patch enable to access usage stats for each algorithm. Signed-off-by: Corentin Labbe --- drivers/crypto/allwinner/Kconfig | 9 .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 21 .../crypto/allwinner/sun4i-ss/sun4i-ss-core.c | 54 +++ .../crypto/a

[PATCH 2/7] crypto: sun4i-ss: checking sg length is not sufficient

2020-09-17 Thread Corentin Labbe
The optimized cipher function need length multiple of 4 bytes. But it get sometimes odd length. This is due to SG data could be stored with an offset. So the fix is to check also if the offset is aligned with 4 bytes. Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto

[PATCH 0/7] crypto: sun4i-ss: prevent always fallback for ciphers

2020-09-17 Thread Corentin Labbe
Hello For help testing on "crypto: sun4i-ss - Fix sparse endianness markers", I have added "stats" support like other allwinner's crypto drivers. Seeing stats showed a clear problem, the ciphers function were not used at all. This is due to the not-inialized need_fallback which is "init" as true e

[PATCH 3/7] crypto: sun4i-ss: IV register does not work on A10 and A13

2020-09-17 Thread Corentin Labbe
Allwinner A10 and A13 SoC have a version of the SS which produce invalid IV in IVx register. Instead of adding a variant for those, let's convert SS to produce IV directly from data. Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator") Cc: Signed-off-by: C

Re: [PATCH 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Nick Terrell
> On Sep 16, 2020, at 7:46 AM, Christoph Hellwig wrote: > > On Wed, Sep 16, 2020 at 10:43:04AM -0400, Chris Mason wrote: >> Otherwise we just end up with drift and kernel-specific bugs that are harder >> to debug. To the extent those APIs make us contort the kernel code, I???m >> sure Nick is

Re: [PATCH 5/9] btrfs: zstd: Switch to the zstd-1.4.6 API

2020-09-17 Thread Nick Terrell
> On Sep 17, 2020, at 7:28 AM, Chris Mason wrote: > > On 17 Sep 2020, at 6:04, Christoph Hellwig wrote: > >> On Wed, Sep 16, 2020 at 09:35:51PM -0400, Rik van Riel wrote: One possibility is to have a kernel wrapper on top of the zstd API to make it more ergonomic. I personally d

[PATCH] crypto: procfs: Removing some useless only space lines

2020-09-17 Thread Corentin Labbe
Some line got only spaces, remove them Signed-off-by: Corentin Labbe --- crypto/proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/proc.c b/crypto/proc.c index 08d8c2bc7e62..12fccb9c5205 100644 --- a/crypto/proc.c +++ b/crypto/proc.c @@ -36,7 +36,7 @@ static vo

[PATCH v3,net-next,3/4] drivers: crypto: add support for OCTEONTX2 CPT engine

2020-09-17 Thread Srujana Challa
Add support for the cryptographic acceleration unit (CPT) on OcteonTX2 CN96XX SoC. Signed-off-by: Suheil Chandran Signed-off-by: Lukas Bartosik Signed-off-by: Srujana Challa --- drivers/crypto/marvell/Kconfig| 13 + drivers/crypto/marvell/Makefile |1 + driv

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

2020-09-17 Thread Jacob Keller
On 9/9/2020 1:55 PM, Keith Busch wrote: > On Wed, Sep 09, 2020 at 01:06:39PM -0700, Joe Perches wrote: >> diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c >> index eea0f453cfb6..8aac5bc60f4c 100644 >> --- a/crypto/tcrypt.c >> +++ b/crypto/tcrypt.c >> @@ -2464,7 +2464,7 @@ static int do_test(const

Re: [PATCH v3,net-next,0/4] Add Support for Marvell OcteonTX2 Cryptographic

2020-09-17 Thread Jakub Kicinski
On Thu, 17 Sep 2020 18:58:31 +0530 Srujana Challa wrote: > The following series adds support for Marvell Cryptographic Acceleration > Unit(CPT) on OcteonTX2 CN96XX SoC. > This series is tested with CRYPTO_EXTRA_TESTS enabled and > CRYPTO_DISABLE_TESTS disabled. No writeable debugfs files, please.

Re: [PATCH v3,net-next,3/4] drivers: crypto: add support for OCTEONTX2 CPT engine

2020-09-17 Thread kernel test robot
Hi Srujana, I love your patch! Yet something to improve: [auto build test ERROR on cryptodev/master] [also build test ERROR on crypto/master sparc-next/master v5.9-rc5 next-20200917] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to

Re: [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-17 Thread miaoqinglang
h against linux-next(20200917), and it can be applied to mainline cleanly now. There won't be conflicts anymore, Thanks. Thanks,

Re: [PATCH -next] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-17 Thread miaoqinglang
over direct seq_read method calls to seq_read_iter") Hi Horia, I noticed that 4d4901c6d748 in linux-next has been reverted, so I resent a new patch against linux-next(20200917), and it can be applied to mainline cleanly now. Thanks. Horia

[PATCH -next v2] crypto: allwinner - Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-17 Thread Qinglang Miao
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 15 ++- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c

[PATCH -next v2] crypto: cavium/zip - Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-17 Thread Qinglang Miao
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. drivers/crypto/cavium/zip/zip_main.c | 44 1 file changed, 6 insertions(+), 38 deletions

[PATCH -next v2] crypto: caam: Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-17 Thread Qinglang Miao
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. drivers/crypto/caam/dpseci-debugfs.c | 23 ++- 1 file changed, 2 insertions(+), 21 deletions(-) diff

[PATCH -next v2] crypto: amlogic: Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-17 Thread Qinglang Miao
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. drivers/crypto/amlogic/amlogic-gxl-core.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff

[PATCH -next v2] crypto: hisilicon/qm - Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-17 Thread Qinglang Miao
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao --- v2: based on linux-next(20200917), and can be applied to mainline cleanly now. drivers/crypto/hisilicon/qm.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers

[PATCH AUTOSEL 4.19 078/206] crypto: chelsio - This fixes the kernel panic which occurs during a libkcapi test

2020-09-17 Thread Sasha Levin
From: Ayush Sawal [ Upstream commit 9195189e00a7db55e7d448cee973cae87c5a3c71 ] The libkcapi test which causes kernel panic is aead asynchronous vmsplice multiple test. ./bin/kcapi -v -d 4 -x 10 -c "ccm(aes)" -q 4edb58e8d5eb6bc711c43a6f3693daebde2e5524f1b55297abb29f003236e43d -t a7877c99 -n 6

[PATCH AUTOSEL 4.19 017/206] net: silence data-races on sk_backlog.tail

2020-09-17 Thread Sasha Levin
From: Eric Dumazet [ Upstream commit 9ed498c6280a2f2b51d02df96df53037272ede49 ] sk->sk_backlog.tail might be read without holding the socket spinlock, we need to add proper READ_ONCE()/WRITE_ONCE() to silence the warnings. KCSAN reported : BUG: KCSAN: data-race in tcp_add_backlog / tcp_recvmsg

[PATCH AUTOSEL 5.4 128/330] crypto: chelsio - This fixes the kernel panic which occurs during a libkcapi test

2020-09-17 Thread Sasha Levin
From: Ayush Sawal [ Upstream commit 9195189e00a7db55e7d448cee973cae87c5a3c71 ] The libkcapi test which causes kernel panic is aead asynchronous vmsplice multiple test. ./bin/kcapi -v -d 4 -x 10 -c "ccm(aes)" -q 4edb58e8d5eb6bc711c43a6f3693daebde2e5524f1b55297abb29f003236e43d -t a7877c99 -n 6

[PATCH AUTOSEL 5.4 031/330] net: silence data-races on sk_backlog.tail

2020-09-17 Thread Sasha Levin
From: Eric Dumazet [ Upstream commit 9ed498c6280a2f2b51d02df96df53037272ede49 ] sk->sk_backlog.tail might be read without holding the socket spinlock, we need to add proper READ_ONCE()/WRITE_ONCE() to silence the warnings. KCSAN reported : BUG: KCSAN: data-race in tcp_add_backlog / tcp_recvmsg

linux-next: manual merge of the staging tree with the crypto tree

2020-09-17 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the staging tree got a conflict in: drivers/staging/rtl8192e/Kconfig between commit: 054694a46d64 ("staging/rtl8192e: switch to RC4 library interface") from the crypto tree and commits: 243d040a6e4a ("staging: rtl8192e: fix kconfig dependency warning

Re: linux-next: manual merge of the staging tree with the crypto tree

2020-09-17 Thread Herbert Xu
On Fri, Sep 18, 2020 at 03:21:27PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the staging tree got a conflict in: > > drivers/staging/rtl8192e/Kconfig > > between commit: > > 054694a46d64 ("staging/rtl8192e: switch to RC4 library interface") > > from the crypt

Re: [PATCH v8] crypto: af_alg - add extra parameters for DRBG interface

2020-09-17 Thread Herbert Xu
On Wed, Sep 16, 2020 at 12:07:31PM +0100, Elena Petrova wrote: > > @@ -148,20 +260,58 @@ static int rng_accept_parent(void *private, struct sock > *sk) >* state of the RNG. >*/ > > - ctx->drng = private; > + ctx->drng = pctx->drng; > ask->private = ctx; > sk->

Re: [PATCH v6 5/8] crypto: testmgr - support test with different ciphertext per encryption

2020-09-17 Thread Herbert Xu
On Thu, Sep 03, 2020 at 09:12:39PM +0800, Tianjia Zhang wrote: > Some asymmetric algorithms will get different ciphertext after > each encryption, such as SM2, and let testmgr support the testing > of such algorithms. > > In struct akcipher_testvec, set c and c_size to be empty, skip > the compari

Re: [PATCH] crypto: inside-secure - Fix corruption on not fully coherent systems

2020-09-17 Thread Herbert Xu
On Mon, Sep 07, 2020 at 10:19:44AM +0200, Pascal van Leeuwen wrote: > > @@ -921,9 +943,20 @@ static int safexcel_ahash_cra_init(struct crypto_tfm > *tfm) > ctx->base.send = safexcel_ahash_send; > ctx->base.handle_result = safexcel_handle_result; > ctx->fb_do_setkey = false; > +