Re: [PATCH 0/3] More code cleanups

2017-11-05 Thread Greg Kroah-Hartman
On Mon, Nov 06, 2017 at 09:41:09AM +0200, Gilad Ben-Yossef wrote: > On Mon, Nov 6, 2017 at 9:38 AM, Greg Kroah-Hartman > wrote: > > On Mon, Nov 06, 2017 at 06:55:49AM +, Gilad Ben-Yossef wrote: > >> Additional code readability and simplification patches. > >> These

Re: [PATCH 0/3] More code cleanups

2017-11-05 Thread Gilad Ben-Yossef
On Mon, Nov 6, 2017 at 9:38 AM, Greg Kroah-Hartman wrote: > On Mon, Nov 06, 2017 at 06:55:49AM +, Gilad Ben-Yossef wrote: >> Additional code readability and simplification patches. >> These goes on top the previous patch set sent to the list. > > Please label your

Re: [PATCH 0/3] More code cleanups

2017-11-05 Thread Greg Kroah-Hartman
On Mon, Nov 06, 2017 at 06:55:49AM +, Gilad Ben-Yossef wrote: > Additional code readability and simplification patches. > These goes on top the previous patch set sent to the list. Please label your 0/X patches the same way your patches are, with the prefix of the subsystem, otherwise they

Re: [PATCH] crypto: chcr - Replace _manual_ swap with swap macro

2017-11-05 Thread Herbert Xu
On Fri, Nov 03, 2017 at 11:58:23AM -0500, Gustavo A. R. Silva wrote: > Make use of the swap macro and remove unnecessary variable temp. > This makes the code easier to read and maintain. > > This code was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva

Re: virtio:rng: Virtio RNG devices need to be re-registered after suspend/resume

2017-11-05 Thread Herbert Xu
On Fri, Nov 03, 2017 at 09:57:21AM +, Jim Quigley wrote: > The patch for > > commit: 5c06273401f2eb7b290cadbae18ee00f8f65e893 > Author: Amit Shah > Date: Sun Jul 27 07:34:01 2014 +0930 > > virtio: rng: delay hwrng_register() till driver is ready > > moved the

Re: [PATCH] crypto: marvell - Add a NULL entry at the end of mv_cesa_plat_id_table[]

2017-11-05 Thread Herbert Xu
On Fri, Nov 03, 2017 at 05:52:01PM +0100, Boris Brezillon wrote: > struct platform_device_id should be NULL terminated to let the core detect > where the last entry is. > > Fixes: 07c50a8be41a ("crypto: marvell - Add a platform_device_id table") > Signed-off-by: Boris Brezillon

Re: [v3 PATCH 2/3] crypto: atmel-aes/tdes - remove empty functions

2017-11-05 Thread Herbert Xu
On Thu, Nov 02, 2017 at 05:12:25PM +0200, Tudor Ambarus wrote: > Pointer members of an object with static storage duration, if not > explicitly initialized, will be initialized to a NULL pointer. > The crypto API checks if these pointers are not NULL before using them, > therefore we can safely

Re: [PATCH] MAINTAINERS: update maintainer for qat

2017-11-05 Thread Herbert Xu
On Thu, Nov 02, 2017 at 09:09:06AM +, Salvatore Benedetto wrote: > Removing myself as I'm not longer following QAT development. > > Signed-off-by: Salvatore Benedetto Patch applied. Thanks. -- Email: Herbert Xu Home Page:

Re: [PATCH] crypto: ecdh - remove empty exit()

2017-11-05 Thread Herbert Xu
On Thu, Nov 02, 2017 at 04:46:47PM +0200, Tudor Ambarus wrote: > Pointer members of an object with static storage duration, if not > explicitly initialized, will be initialized to a NULL pointer. The crypto > API checks if this pointer is not NULL before using it, we are safe to > remove the

Re: [PATCH 2/2] crypto: caam - remove unused param of ctx_map_to_sec4_sg()

2017-11-05 Thread Herbert Xu
On Wed, Nov 01, 2017 at 09:13:11AM +0200, Horia Geantă wrote: > ctx_map_to_sec4_sg() function, added in > commit 045e36780f115 ("crypto: caam - ahash hmac support") > has never used the "desc" parameter, so let's drop it. > > Signed-off-by: Horia Geantă Patch applied.

Re: [PATCH 1/2] crypto: caam - remove unneeded edesc zeroization

2017-11-05 Thread Herbert Xu
On Wed, Nov 01, 2017 at 09:13:10AM +0200, Horia Geantă wrote: > Extended descriptor allocation has been changed by > commit dde20ae9d6383 ("crypto: caam - Change kmalloc to kzalloc to avoid > residual data") > to provide zeroized memory, meaning we no longer have to sanitize > its members -

[PATCH 2/3] staging: ccree: simplify registers access

2017-11-05 Thread Gilad Ben-Yossef
The register offset calculation macro was taking a HW block base parameter that was not actually used. Simplify the whole thing by dropping it and rename the macro for better readability. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_regs.h | 15

[PATCH 0/3] More code cleanups

2017-11-05 Thread Gilad Ben-Yossef
Additional code readability and simplification patches. These goes on top the previous patch set sent to the list. Gilad Ben-Yossef (3): staging: ccree: simplify error handling logic staging: ccree: simplify registers access staging: ccree: simplify ioread/iowrite

[PATCH 3/3] staging: ccree: simplify ioread/iowrite

2017-11-05 Thread Gilad Ben-Yossef
Registers ioread/iowrite operations were done via macros, sometime using a "magical" implicit parameter. Replace all register access with simple inline macros. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/cc_hal.h | 33 --

[PATCH 1/3] staging: ccree: simplify error handling logic

2017-11-05 Thread Gilad Ben-Yossef
Turn the code sites that don't require any special handling on error return to a simple return. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_driver.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git

Crypto Fixes for 4.14

2017-11-05 Thread Herbert Xu
Hi Linus: This push fixes an unaligned panic in x86/sha-mb and a bug in ccm that triggers with certain underlying implementations. Please pull from git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git linus Andrey Ryabinin (2): crypto: x86/sha256-mb - fix panic due to

[PATCH v2 2/5] crypto: dh - Don't permit 'p' to be 0

2017-11-05 Thread Eric Biggers
From: Eric Biggers If 'p' is 0 for the software Diffie-Hellman implementation, then dh_max_size() returns 0. In the case of KEYCTL_DH_COMPUTE, this causes ZERO_SIZE_PTR to be passed to sg_init_one(), which with CONFIG_DEBUG_SG=y triggers the 'BUG_ON(!virt_addr_valid(buf));'

[PATCH v2 1/5] crypto: dh - Fix double free of ctx->p

2017-11-05 Thread Eric Biggers
From: Eric Biggers When setting the secret with the software Diffie-Hellman implementation, if allocating 'g' failed (e.g. if it was longer than MAX_EXTERN_MPI_BITS), then 'p' was freed twice: once immediately, and once later when the crypto_kpp tfm was destroyed. Fix it by

[PATCH v2 4/5] crypto: qat - Clean up error handling in qat_dh_set_secret()

2017-11-05 Thread Eric Biggers
From: Eric Biggers Update the error handling in qat_dh_set_secret() to mirror dh_set_secret(). The new version is less error-prone because freeing memory and setting the pointers to NULL is now only done in one place. Signed-off-by: Eric Biggers ---

[PATCH v2 3/5] crypto: dh - Don't permit 'key' or 'g' size longer than 'p'

2017-11-05 Thread Eric Biggers
From: Eric Biggers The "qat-dh" DH implementation assumes that 'key' and 'g' can be copied into a buffer with size 'p_size'. However it was never checked that that was actually the case, which most likely allowed users to cause a buffer underflow via KEYCTL_DH_COMPUTE. Fix

[PATCH v2 5/5] crypto: dh - Remove pointless checks for NULL 'p' and 'g'

2017-11-05 Thread Eric Biggers
From: Eric Biggers Neither 'p' nor 'g' can be NULL, as they were unpacked using crypto_dh_decode_key(). And it makes no sense for them to be optional. So remove the NULL checks that were copy-and-pasted into both modules. Signed-off-by: Eric Biggers

[PATCH v2 0/5] crypto: dh - input validation fixes

2017-11-05 Thread Eric Biggers
This series fixes several corner cases in the Diffie-Hellman key exchange implementations: 1. With the software DH implementation, using a large buffer for 'g' caused a double free. 2. With CONFIG_DEBUG_SG=y and the software DH implementation, setting 'p' to 0 caused a BUG_ON(). 3. With the

Re: [PATCH v2] tpm: Move Linux RNG connection to hwrng

2017-11-05 Thread Jason Gunthorpe
On Sun, Nov 05, 2017 at 01:05:06PM +0200, Jarkko Sakkinen wrote: > I asked to create a series for a reason. Now this doesn't apply because I > don't have an ancestor in my git history. It would be unusual for me to put your patch into a series unless I am also adopting it. eg what happens if

Re: [Part2 PATCH v7 20/38] crypto: ccp: Implement SEV_PDH_CERT_EXPORT ioctl command

2017-11-05 Thread Borislav Petkov
On Wed, Nov 01, 2017 at 04:16:05PM -0500, Brijesh Singh wrote: > The SEV_PDH_CERT_EXPORT command can be used to export the PDH and its > certificate chain. The command is defined in SEV spec section 5.10. ... > --- > drivers/crypto/ccp/psp-dev.c | 98 >

Re: [PATCH v2] tpm: Move Linux RNG connection to hwrng

2017-11-05 Thread Jarkko Sakkinen
On Tue, Oct 31, 2017 at 02:05:03PM -0600, Jason Gunthorpe wrote: > The tpm-rng.c approach is completely inconsistent with how the kernel > handles hotplug. Instead manage a hwrng device for each TPM. This will > cause the kernel to read entropy from the TPM when it is plugged in, > and allow