Re: [PATCH v2] crypto: AF_ALG - limit mask and type

2017-12-21 Thread Herbert Xu
On Fri, Dec 22, 2017 at 08:41:10AM +0100, Stephan Mueller wrote: > > Shouldn't we then rather use a white list instead of a black list? > > > > Most other problems however would be bugs in the template code. > > The first thing a template does when it creates an instance is > > to check whether

Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-21 Thread Herbert Xu
On Fri, Dec 22, 2017 at 08:50:01AM +0100, Stephan Mueller wrote: > Am Freitag, 22. Dezember 2017, 08:48:03 CET schrieb Herbert Xu: > > Hi Herbert, > > > On Tue, Dec 19, 2017 at 10:31:22AM +, Jonathan Cameron wrote: > > > This variable was increased and decreased without any protection. > > >

Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-21 Thread Stephan Mueller
Am Freitag, 22. Dezember 2017, 08:48:03 CET schrieb Herbert Xu: Hi Herbert, > On Tue, Dec 19, 2017 at 10:31:22AM +, Jonathan Cameron wrote: > > This variable was increased and decreased without any protection. > > Result was an occasional misscount and negative wrap around resulting > > in

Re: [PATCH] crypto: Fix race around ctx->rcvused by making it atomic_t

2017-12-21 Thread Herbert Xu
On Tue, Dec 19, 2017 at 10:31:22AM +, Jonathan Cameron wrote: > This variable was increased and decreased without any protection. > Result was an occasional misscount and negative wrap around resulting > in false resource allocation failures. > > Signed-off-by: Jonathan Cameron

Re: [PATCH v2] crypto: AF_ALG - limit mask and type

2017-12-21 Thread Stephan Mueller
Am Freitag, 22. Dezember 2017, 08:36:07 CET schrieb Herbert Xu: Hi Herbert, > On Tue, Dec 19, 2017 at 07:25:04AM +0100, Stephan Müller wrote: > > The user space interface allows specifying the type and the mask field > > used to allocate the cipher. As user space can precisely select the > >

Re: [PATCH v2] crypto: AF_ALG - limit mask and type

2017-12-21 Thread Herbert Xu
On Tue, Dec 19, 2017 at 07:25:04AM +0100, Stephan Müller wrote: > The user space interface allows specifying the type and the mask field > used to allocate the cipher. As user space can precisely select the > desired cipher by using either the name or the driver name, additional > selection

Re: [PATCH] lib/mpi: Fix umul_ppmm() for MIPS64r6

2017-12-21 Thread Herbert Xu
On Tue, Dec 05, 2017 at 11:31:35PM +, James Hogan wrote: > From: James Hogan > > Current MIPS64r6 toolchains aren't able to generate efficient > DMULU/DMUHU based code for the C implementation of umul_ppmm(), which > performs an unsigned 64 x 64 bit multiply and returns

Crypto Fixes for 4.15

2017-12-21 Thread Herbert Xu
Hi Linus: This push fixes the following issues: - Fix chacha20 crash on zero-length input due to unset IV. - Fix potential race conditions in mcryptd with spinlock. - Only wait once at top of algif recvmsg to avoid inconsistencies. - Fix potential use-after-free in algif_aead/algif_skcipher.

Re: [PATCH RFC 2/3] crypto: Implement a generic crypto statistics

2017-12-21 Thread Herbert Xu
On Wed, Dec 20, 2017 at 08:09:26PM +, Corentin Labbe wrote: > This patch implement a generic way to get statistics about all crypto > usages. > > Signed-off-by: Corentin Labbe Please don't use sysfs. We already have crypto_user and this should be exposed through that.

Re: BUG: unable to handle kernel paging request in hmac_init_tfm

2017-12-21 Thread Eric Biggers
ot;.) > > Ouch! That would be pretty bad. > > But I've tried both linux-next HEAD at: > > commit 0e08c463db387a2adcb0243b15ab868a73f87807 (HEAD, tag: > next-20171221, linux-next/master) > Author: Stephen Rothwell <s...@canb.auug.org.au> > Date: Thu Dec 21 15:37:3

Re: [PATCH RFC 1/3] crypto: Prevent to register duplicate cra_driver_name

2017-12-21 Thread LABBE Corentin
On Thu, Dec 21, 2017 at 01:35:27PM +0100, LABBE Corentin wrote: > On Thu, Dec 21, 2017 at 05:35:22PM +1100, Herbert Xu wrote: > > On Wed, Dec 20, 2017 at 08:09:25PM +, Corentin Labbe wrote: > > > Each crypto algorithm "cra_name" can have multiple implementation called > > > "cra_driver_name".

Re: [PATCH RFC 2/3] crypto: Implement a generic crypto statistics

2017-12-21 Thread LABBE Corentin
On Thu, Dec 21, 2017 at 07:38:35AM +0100, Stephan Mueller wrote: > Am Mittwoch, 20. Dezember 2017, 21:09:26 CET schrieb Corentin Labbe: > > Hi Corentin, > > > This patch implement a generic way to get statistics about all crypto > > usages. > > > > Signed-off-by: Corentin Labbe

Re: [PATCH] staging: ccree: fix type mismatch warning

2017-12-21 Thread Greg Kroah-Hartman
On Thu, Dec 21, 2017 at 02:31:20PM +0100, Arnd Bergmann wrote: > __dump_byte_array used to be hidden, but is now visible to the compiler > and causes a harmless warning: > > drivers/staging/ccree/ssi_driver.c:82:6: error: conflicting types for > '__dump_byte_array' >

Re: [PATCH] staging: ccree: fix __dump_byte_array() declaration mismatch

2017-12-21 Thread Greg KH
On Wed, Dec 20, 2017 at 06:16:08PM +, Corentin Labbe wrote: > This patch corrects the type of the size argument in __dump_byte_array() > from unsigned long to size_t as done only in > drivers/staging/ccree/ssi_driver.c > > This fix also a build error: >

Re: [Part2 PATCH v9 00/38] x86: Secure Encrypted Virtualization (AMD)

2017-12-21 Thread Brijesh Singh
On 12/21/17 9:51 AM, Brijesh Singh wrote: > > On 12/21/17 7:06 AM, Paolo Bonzini wrote: > > > Hi Paolo, >   > >> Hi Brijesh, >> >> I have a couple comments: >> >> 1) how is MSR_AMD64_SEV's value passed to the guest, and where is it in >> the manual? > It is a non interceptable read-only MSR

Re: [Part2 PATCH v9 00/38] x86: Secure Encrypted Virtualization (AMD)

2017-12-21 Thread Brijesh Singh
On 12/21/17 7:06 AM, Paolo Bonzini wrote: Hi Paolo,   > Hi Brijesh, > > I have a couple comments: > > 1) how is MSR_AMD64_SEV's value passed to the guest, and where is it in > the manual? It is a non interceptable read-only MSR set by the HW when SEV feature is enabled in VMRUN

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-21 Thread PrasannaKumar Muralidharan
Hi Ard, On 21 December 2017 at 17:52, Ard Biesheuvel wrote: > On 21 December 2017 at 10:20, Arnd Bergmann wrote: >> On Wed, Dec 20, 2017 at 10:46 PM, Jakub Jelinek wrote: >>> On Wed, Dec 20, 2017 at 09:52:05PM +0100, Arnd Bergmann

[PATCH] staging: ccree: fix type mismatch warning

2017-12-21 Thread Arnd Bergmann
__dump_byte_array used to be hidden, but is now visible to the compiler and causes a harmless warning: drivers/staging/ccree/ssi_driver.c:82:6: error: conflicting types for '__dump_byte_array' drivers/staging/ccree/ssi_driver.c: In function '__dump_byte_array':

Re: [Part2 PATCH v9 00/38] x86: Secure Encrypted Virtualization (AMD)

2017-12-21 Thread Paolo Bonzini
On 05/12/2017 02:04, Brijesh Singh wrote: > This part of Secure Encrypted Virtualization (SEV) patch series focuses on KVM > changes required to create and manage SEV guests. > > SEV is an extension to the AMD-V architecture which supports running encrypted > virtual machine (VMs) under the

Re: [PATCH RFC 1/3] crypto: Prevent to register duplicate cra_driver_name

2017-12-21 Thread LABBE Corentin
On Thu, Dec 21, 2017 at 05:35:22PM +1100, Herbert Xu wrote: > On Wed, Dec 20, 2017 at 08:09:25PM +, Corentin Labbe wrote: > > Each crypto algorithm "cra_name" can have multiple implementation called > > "cra_driver_name". > > If two different implementation have the same cra_driver_name,

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-21 Thread Ard Biesheuvel
On 21 December 2017 at 10:20, Arnd Bergmann wrote: > On Wed, Dec 20, 2017 at 10:46 PM, Jakub Jelinek wrote: >> On Wed, Dec 20, 2017 at 09:52:05PM +0100, Arnd Bergmann wrote: >>> diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c >>> index

[PATCH] padata: add SPDX identifier

2017-12-21 Thread Cheah Kok Cheong
Add SPDX license identifier according to the type of license text found in the file. Cc: Philippe Ombredanne Signed-off-by: Cheah Kok Cheong --- kernel/padata.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/padata.c b/kernel/padata.c index

Re: [PATCH 1/2] padata: Remove FSF address

2017-12-21 Thread Cheah Kok Cheong
On Thu, Dec 21, 2017 at 08:34:37AM +0100, Philippe Ombredanne wrote: > Dear CheahKC, > > On Wed, Dec 20, 2017 at 10:17 PM, Cheah Kok Cheong wrote: > > On Wed, Dec 20, 2017 at 09:20:48PM +0100, Philippe Ombredanne wrote: > >> On Wed, Dec 20, 2017 at 9:15 PM, Cheah Kok Cheong

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-21 Thread Arnd Bergmann
On Wed, Dec 20, 2017 at 10:46 PM, Jakub Jelinek wrote: > On Wed, Dec 20, 2017 at 09:52:05PM +0100, Arnd Bergmann wrote: >> diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c >> index ca554d57d01e..35f973ba9878 100644 >> --- a/crypto/aes_generic.c >> +++

Re: [PATCH] crypto: pcrypt - fix freeing pcrypt instances

2017-12-21 Thread Dmitry Vyukov
On Wed, Dec 20, 2017 at 11:28 PM, Eric Biggers wrote: > From: Eric Biggers > > pcrypt is using the old way of freeing instances, where the ->free() > method specified in the 'struct crypto_template' is passed a pointer to > the 'struct crypto_instance'.