Re: Null pointer dereference in public key verification (related to SM2 introduction)

2021-01-07 Thread Tianjia Zhang
Hi, Sorry, I just read this email. I will submit the fix patch as soon as possible. Thanks for reporting. Best regards, Tianjia On 1/7/21 3:27 PM, Tee Hao Wei wrote: On 2/12/20 8:24 pm, Tobias Markus wrote: Hi David, I'm afraid I can't provide an exactly matching disassembly of the functi

Re: [PATCH 00/10] Remove support for TX49xx

2021-01-07 Thread Geert Uytterhoeven
Hi Nemoto-san, On Thu, Jan 7, 2021 at 2:18 AM Atsushi Nemoto wrote: > On Wed, 6 Jan 2021 21:41:24 +0100, Geert Uytterhoeven > wrote: > >> > Is that sufficient to keep it? > >> > >> for me it is. But now we probaly need some reverts then... > > > > Indeed. Fortunately not all of it, as some remo

Re: Null pointer dereference in public key verification (related to SM2 introduction)

2021-01-07 Thread Jean-Louis Dupond
Hi, I've hit this bug also when trying to connect to my office Wifi via IWD. The pkey_algo is indeed NULL/uninitialized: As we create the sig here: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/crypto/asymmetric_keys/asymmetric_type.c?h=v5.10.5&id=215525639631ade1d67e879

[PATCH] X.509: Fix crash caused by NULL pointer

2021-01-07 Thread Tianjia Zhang
On the following call path, `sig->pkey_algo` is not assigned in asymmetric_key_verify_signature(), which causes runtime crash in public_key_verify_signature(). keyctl_pkey_verify asymmetric_key_verify_signature verify_signature public_key_verify_signature This patch simply che

Re: [PATCH] X.509: Fix crash caused by NULL pointer

2021-01-07 Thread David Howells
Tianjia Zhang wrote: > On the following call path, `sig->pkey_algo` is not assigned > in asymmetric_key_verify_signature(), which causes runtime > crash in public_key_verify_signature(). > > keyctl_pkey_verify > asymmetric_key_verify_signature > verify_signature > public_key_

[PATCH v6 4/6] crypto: expose elliptic curve parameters as Crypto APIs

2021-01-07 Thread Meng Yu
Move elliptic curves definition to 'include/crypto/ecc_curve_defs.h', so all can use it, Signed-off-by: Meng Yu Reviewed-by: Zaibo Xu --- crypto/ecc.c| 1 - crypto/ecc.h| 37 + crypto/ecc_curve_defs.h | 57

[PATCH v6 1/6] crypto: hisilicon/hpre - add version adapt to new algorithms

2021-01-07 Thread Meng Yu
A new generation of accelerator Kunpeng930 has appeared, and the corresponding driver needs to be updated to support some new algorithms of Kunpeng930. To be compatible with Kunpeng920, we add parameter 'struct hisi_qm *qm' to sec_algs_(un)register to identify the chip's version. Signed-off-by: Me

[PATCH v6 0/6] add ECDH and CURVE25519 algorithms support for Kunpeng 930

2021-01-07 Thread Meng Yu
1. Move elliptic curve parameter definitions out to "include/crypto"; 2. Add some new elliptic curve parameters definitions, and reorder ECC 'Curves IDs'; 3. Add ECDH and CURVE25519 algorithms support for Kunpeng 930. v5->v6: - patch #1: add a new patch (the first patch), which is the "depend o

[PATCH v6 3/6] crypto: hisilicon/hpre - add algorithm type

2021-01-07 Thread Meng Yu
Algorithm type is brought in to get hardware HPRE queue to support different algorithms. Signed-off-by: Meng Yu Reviewed-by: Zaibo Xu --- drivers/crypto/hisilicon/hpre/hpre.h| 10 +- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 12 ++-- drivers/crypto/hisilicon/hpre/hpr

[PATCH v6 5/6] crypto: hisilicon/hpre - add 'ECDH' algorithm

2021-01-07 Thread Meng Yu
1. Add some new 'ECDH' curve parameter definitions to 'include/crypto/ecc_curve_defs.h', and reorder ECC 'Curves IDs' in 'include/crypto/ecdh.h'; 2. Enable 'ECDH' algorithm in Kunpeng 930. Signed-off-by: Meng Yu Reviewed-by: Zaibo Xu --- crypto/ecc.c| 4 +

[PATCH v6 6/6] crypto: hisilicon/hpre - add 'CURVE25519' algorithm

2021-01-07 Thread Meng Yu
1. Add 'CURVE25519' curve parameter definition to 'include/crypto/ecc_curve_defs.h'; 2. Enable 'CURVE25519' algorithm in Kunpeng 930. Signed-off-by: Meng Yu Reviewed-by: Zaibo Xu Reported-by: kernel test robot --- drivers/crypto/hisilicon/Kconfig| 1 + drivers/crypto/hisilicon

[PATCH v6 2/6] crypto: hisilicon/hpre - add some updates to adapt to Kunpeng 930

2021-01-07 Thread Meng Yu
From: Hui Tang HPRE of Kunpeng 930 is updated on cluster numbers and configurations of Kunpeng 920 HPRE, so we try to update this driver to make it running okay on both chips. Signed-off-by: Hui Tang Signed-off-by: Meng Yu Reviewed-by: Zaibo Xu --- drivers/crypto/hisilicon/hpre/hpre.h |

[PATCH v2 00/19]crypto: convert tasklets to use new tasklet_setup API()

2021-01-07 Thread Allen Pais
From: Allen Pais Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")' introduced a new tasklet initialization API. This series converts all the crypto modules to use the new tasklet_setup() API The series is based on v5.11-rc2 (e71ba9452f0b) v2: - added acks - addressed commen

[PATCH v2 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 02/19] crypto: atmel: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 03/19] crypto: axis: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 04/19] crypto: caam: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Reviewed-by: Horia Geantă Signed-off-by: Romain Perier Signed-off-by: Allen

[PATCH v2 05/19] crypto: cavium: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 06/19] crypto: ccp: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 07/19] crypto: ccree: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 08/19] crypto: hifn_795x: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 10/19] crypto: ixp4xx: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 11/19] crypto: mediatek: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 09/19] crypto: img-hash: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 12/19] crypto: omap: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 14/19] crypto: qat: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 15/19] crypto: qce: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 17/19] crypto: s5p: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Acked-by: Krzysztof Kozlowski Signed-off-by: Romain Perier Signed-off-by: A

[PATCH v2 18/19] crypto: talitos: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 19/19] crypto: octeontx: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Allen Pais --- drivers/crypto/marvell/octeontx/otx_cptvf_mai

[PATCH v2 16/19] crypto: rockchip: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

[PATCH v2 13/19] crypto: picoxcell: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/crypto/

Re: [PATCH v2 16/19] crypto: rockchip: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Emil Renner Berthing
Hi Allen, On Thu, 7 Jan 2021 at 13:32, Allen Pais wrote: > > From: Allen Pais > > In preparation for unconditionally passing the > struct tasklet_struct pointer to all tasklet > callbacks, switch to using the new tasklet_setup() > and from_tasklet() to pass the tasklet pointer explicitly. > > Si

[PATCH] crypto - shash: reduce minimum alignment of shash_desc structure

2021-01-07 Thread Ard Biesheuvel
Unlike many other structure types defined in the crypto API, the 'shash_desc' structure is permitted to live on the stack, which implies its contents may not be accessed by DMA masters. (This is due to the fact that the stack may be located in the vmalloc area, which requires a different virtual-to

Re: [PATCH v2 16/19] crypto: rockchip: convert tasklets to use new tasklet_setup() API

2021-01-07 Thread Allen Pais
On Thu, 7 Jan 2021 at 13:32, Allen Pais wrote: From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain

Re: problem with ccp-crypto module on apu

2021-01-07 Thread John Allen
On Mon, Jan 04, 2021 at 04:10:26PM +, Domen Stangar wrote: > Device name: ccp-1 >RNG name: ccp-1-rng ># Queues: 3 > # Cmds: 0 > Version: 5 > Engines: AES 3DES SHA RSA ECC ZDE TRNG > Queues: 5 > LSB Entries: 128 > > Let me know if you need anything else. Hi Domen, Lo

Re: [PATCH v6 5/6] crypto: hisilicon/hpre - add 'ECDH' algorithm

2021-01-07 Thread kernel test robot
submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Meng-Yu/add-ECDH-and-CURVE25519-algorithms-support-for-Kunpeng-930/20210107-201957 base: https://git.kernel.org/pub/scm/linux/

Re: [PATCH v1 2/3] x86/cpu: Set low performance CRC32C flag on some Zhaoxin CPUs

2021-01-07 Thread Dave Hansen
On 1/6/21 10:19 PM, Tony W Wang-oc wrote: > + /* > + * These CPUs declare support SSE4.2 instruction sets but > + * having low performance CRC32C instruction implementation. > + */ > + if (c->x86 == 0x6 || (c->x86 == 0x7 && c->x86_model <= 0x3b)) > + set_cpu_cap(c

Re: [PATCH 05/10] dma: tx49 removal

2021-01-07 Thread Thomas Bogendoerfer
On Wed, Jan 06, 2021 at 11:10:38AM -0800, Joe Perches wrote: > On Tue, 2021-01-05 at 15:02 +0100, Thomas Bogendoerfer wrote: > > Signed-off-by: Thomas Bogendoerfer > [] > > diff --git a/drivers/dma/txx9dmac.h b/drivers/dma/txx9dmac.h > [] > > @@ -26,11 +26,6 @@ > >   * DMA channel. > >   */ > >  

Re: [PATCH 5/5] fs: use HKDF implementation from kernel crypto API

2021-01-07 Thread Eric Biggers
On Thu, Jan 07, 2021 at 08:49:52AM +0100, Stephan Mueller wrote: > > > -int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, const u8 *master_key, > > > +int fscrypt_init_hkdf(struct fscrypt_hkdf *hkdf, u8 *master_key, > > >   unsigned int master_key_size); > > > > It shouldn't be

Re: [PATCH 3/5] crypto: add RFC5869 HKDF

2021-01-07 Thread Eric Biggers
On Thu, Jan 07, 2021 at 08:53:15AM +0100, Stephan Mueller wrote: > > > > > RFC5869 > > > allows two optional parameters to be provided to the extract operation: > > > the salt and additional information. Both are to be provided with the > > > seed parameter where the salt is the first entry of the

Re: [PATCH] crypto - shash: reduce minimum alignment of shash_desc structure

2021-01-07 Thread Eric Biggers
On Thu, Jan 07, 2021 at 01:41:28PM +0100, Ard Biesheuvel wrote: > Unlike many other structure types defined in the crypto API, the > 'shash_desc' structure is permitted to live on the stack, which > implies its contents may not be accessed by DMA masters. (This is > due to the fact that the stack m

[GIT PULL] Crypto Fixes for 5.11

2021-01-07 Thread Herbert Xu
Hi Linus: This push fixes a functional bug in arm/chacha-neon as well as a potential buffer overflow in ecdh. The following changes since commit 5c8fe583cce542aa0b84adc939ce85293de36e5e: Linux 5.11-rc1 (2020-12-27 15:30:22 -0800) are available in the Git repository at: git://git.kernel.org

Re: [PATCH v2] crypto: Fix divide error in do_xor_speed()

2021-01-07 Thread Herbert Xu
On Tue, Jan 05, 2021 at 01:24:18PM -0800, Doug Anderson wrote: > > ...so while I think your fix will avoid the crash and could land as a > stopgap, it's a sign that we need to run more repetitions on your > particular setup to get accurate timings. Your patch will probably > cause it to just rando

Re: [PATCH v2 0/2] crypto: x86/aes-ni-xts - recover and improve performance

2021-01-07 Thread Herbert Xu
On Thu, Dec 31, 2020 at 05:41:53PM +0100, Ard Biesheuvel wrote: > The AES-NI implementation of XTS was impacted significantly by the retpoline > changes, which is due to the fact that both its asm helper and the chaining > mode glue library use indirect calls for processing small quantitities of >

Re: [PATCH v2] crypto: Fix divide error in do_xor_speed()

2021-01-07 Thread Herbert Xu
On Thu, Dec 31, 2020 at 12:33:18AM +0300, Kirill Tkhai wrote: > crypto: Fix divide error in do_xor_speed() > > From: Kirill Tkhai > > Latest (but not only latest) linux-next panics with divide > error on my QEMU setup. > > The patch at the bottom of this message fixes the problem. > > xor: mea

Re: [PATCH] crypto: omap-sham - Fix link error without crypto-engine

2021-01-07 Thread Herbert Xu
On Sun, Jan 03, 2021 at 03:03:04PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > The driver was converted to use the crypto engine helper > but is missing the corresponding Kconfig statement to ensure > it is available: > > arm-linux-gnueabi-ld: drivers/crypto/omap-sham.o: in function >