Re: [PATCH] crypto: squash lines for simple wrapper functions

2016-09-13 Thread Joe Perches
On Wed, 2016-09-14 at 11:10 +0900, Masahiro Yamada wrote: > 2016-09-13 4:44 GMT+09:00 Joe Perches : > > On Tue, 2016-09-13 at 04:27 +0900, Masahiro Yamada wrote: > > > Remove unneeded variables and assignments. > > Was this found by visual inspection or some tool? > > If it's via a tool, it's good

Re: [PATCH] crypto: squash lines for simple wrapper functions

2016-09-13 Thread Masahiro Yamada
Hi Joe, 2016-09-13 4:44 GMT+09:00 Joe Perches : > On Tue, 2016-09-13 at 04:27 +0900, Masahiro Yamada wrote: >> Remove unneeded variables and assignments. > > Was this found by visual inspection or some tool? > > If it's via a tool, it's good to mention that in the changelog. I used Coccinelle, b

Re: [PATCH] hwrng: pasemi-rng - Use linux/io.h instead of asm/io.h

2016-09-13 Thread Michael Ellerman
Herbert Xu writes: > On Tue, Sep 06, 2016 at 01:58:39PM +0530, PrasannaKumar Muralidharan wrote: >> Checkpatch.pl warns about usage of asm/io.h. Use linux/io.h instead. >> >> Signed-off-by: PrasannaKumar Muralidharan > > Patch applied. Thanks. Oops I merged it too, my bad. Hopefully git will

[BUG] crypto: atmel-aes - erro when compiling with VERBOSE_DEBUG enable

2016-09-13 Thread levent demir
Hello, if you enable VERBOSE_DEBUG and compile you will have the following error : drivers/crypto/atmel-aes.c:323:5: error: too few arguments to function 'atmel_aes_reg_name' atmel_aes_reg_name(offset, tmp)); ^ include/linux/device.h:1306:41: note: in definition of macro 'dev_vdbg'

Re: [PATCH v2 2/2] crypto: qat - fix resource release omissions

2016-09-13 Thread Quentin Lambert
On 13/09/2016 14:40, Herbert Xu wrote: On Tue, Sep 06, 2016 at 11:18:51AM +0100, Giovanni Cabiddu wrote: ---8<--- Subject: [PATCH] crypto: qat - fix leak on error path Fix a memory leak in an error path in uc loader. Signed-off-by: Giovanni Cabiddu Patch applied. Thanks. Sorry, I complet

[PATCH v7 4/9] crypto: acomp - add support for lzo via scomp

2016-09-13 Thread Giovanni Cabiddu
Add scomp backend for lzo compression algorithm Signed-off-by: Giovanni Cabiddu --- crypto/Kconfig |1 + crypto/lzo.c | 146 +++- 2 files changed, 134 insertions(+), 13 deletions(-) diff --git a/crypto/Kconfig b/crypto/Kconfig index f55

[PATCH v7 7/9] crypto: acomp - add support for 842 via scomp

2016-09-13 Thread Giovanni Cabiddu
Add scomp backend for 842 compression algorithm Signed-off-by: Giovanni Cabiddu --- crypto/842.c | 135 +++- crypto/Kconfig |1 + 2 files changed, 134 insertions(+), 2 deletions(-) diff --git a/crypto/842.c b/crypto/842.c index 98e387e.

[PATCH v7 5/9] crypto: acomp - add support for lz4 via scomp

2016-09-13 Thread Giovanni Cabiddu
Add scomp backend for lz4 compression algorithm Signed-off-by: Giovanni Cabiddu --- crypto/Kconfig |1 + crypto/lz4.c | 147 2 files changed, 138 insertions(+), 10 deletions(-) diff --git a/crypto/Kconfig b/crypto/Kconfig index d27

[PATCH v7 0/9] crypto: asynchronous compression api

2016-09-13 Thread Giovanni Cabiddu
The following patch set introduces acomp, a generic asynchronous (de)compression api with support for SG lists. We propose a new crypto type called crypto_acomp_type, a new struct acomp_alg and struct crypto_acomp, together with number of helper functions to register acomp type algorithms and alloc

[PATCH v7 2/9] crypto: add driver-side scomp interface

2016-09-13 Thread Giovanni Cabiddu
Add a synchronous back-end (scomp) to acomp. This allows to easily expose the already present compression algorithms in LKCF via acomp Signed-off-by: Giovanni Cabiddu --- crypto/Makefile |1 + crypto/acompress.c | 49 +- crypto/scompress.c

[PATCH v7 8/9] crypto: acomp - add support for deflate via scomp

2016-09-13 Thread Giovanni Cabiddu
Add scomp backend for deflate compression algorithm Signed-off-by: Giovanni Cabiddu --- crypto/Kconfig |1 + crypto/deflate.c | 166 ++--- 2 files changed, 157 insertions(+), 10 deletions(-) diff --git a/crypto/Kconfig b/crypto/Kconfig inde

[PATCH v7 1/9] crypto: add asynchronous compression api

2016-09-13 Thread Giovanni Cabiddu
Add acomp, an asynchronous compression api that uses scatterlist buffers Signed-off-by: Giovanni Cabiddu --- crypto/Kconfig | 10 ++ crypto/Makefile |2 + crypto/acompress.c | 118 crypto/crypto_user.c

[PATCH v7 9/9] crypto: acomp - update testmgr with support for acomp

2016-09-13 Thread Giovanni Cabiddu
Add tests to the test manager for algorithms exposed through the acomp api Signed-off-by: Giovanni Cabiddu --- crypto/testmgr.c | 158 +- 1 files changed, 145 insertions(+), 13 deletions(-) diff --git a/crypto/testmgr.c b/crypto/testmgr.c ind

[PATCH v7 6/9] crypto: acomp - add support for lz4hc via scomp

2016-09-13 Thread Giovanni Cabiddu
Add scomp backend for lz4hc compression algorithm Signed-off-by: Giovanni Cabiddu --- crypto/Kconfig |1 + crypto/lz4hc.c | 147 2 files changed, 138 insertions(+), 10 deletions(-) diff --git a/crypto/Kconfig b/crypto/Kconfig index e

[PATCH v7 3/9] crypto: scomp - add scratch buffers allocator and deallocator

2016-09-13 Thread Giovanni Cabiddu
Add utility functions to allocate and deallocate scratch buffers used by software implementations of scomp Signed-off-by: Giovanni Cabiddu --- crypto/scompress.c | 41 +++ include/crypto/internal/scompress.h |2 + 2 files changed, 43 inserti

Re: [PATCH 1/2] crypto: arm/aes-ctr: fix NULL dereference in tail processing

2016-09-13 Thread Herbert Xu
On Tue, Sep 13, 2016 at 09:48:52AM +0100, Ard Biesheuvel wrote: > The AES-CTR glue code avoids calling into the blkcipher API for the > tail portion of the walk, by comparing the remainder of walk.nbytes > modulo AES_BLOCK_SIZE with the residual nbytes, and jumping straight > into the tail processi

Re: [PATCH] crypto: squash lines for simple wrapper functions

2016-09-13 Thread Herbert Xu
On Tue, Sep 13, 2016 at 04:27:54AM +0900, Masahiro Yamada wrote: > Remove unneeded variables and assignments. > > Signed-off-by: Masahiro Yamada 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] hwrng: geode-rng - Use linux/io.h instead of asm/io.h

2016-09-13 Thread Herbert Xu
On Sun, Sep 11, 2016 at 08:54:26PM +0530, PrasannaKumar Muralidharan wrote: > Fix checkpatch.pl warning by changing from asm/io.h to linux/io.h. In > the mean time arrange the includes in alphabetical order. > > Signed-off-by: PrasannaKumar Muralidharan Patch applied. Thanks. -- Email: Herbert

Re: [PATCH] hwrng: geode-rng - Migrate to managed API

2016-09-13 Thread Herbert Xu
On Sun, Sep 11, 2016 at 08:53:21PM +0530, PrasannaKumar Muralidharan wrote: > Use devm_ioremap and devm_hwrng_register instead of ioremap and > hwrng_register. This removes error handling code. Also moved code around > by removing goto statements. This improves code readability. > > Signed-off-by:

Re: [PATCH -next] hwrng: st - Fix missing clk_disable_unprepare() on error in st_rng_probe()

2016-09-13 Thread Herbert Xu
On Sat, Sep 10, 2016 at 12:03:42PM +, Wei Yongjun wrote: > From: Wei Yongjun > > Fix the missing clk_disable_unprepare() before return > from st_rng_probe() in the error handling case. > > Signed-off-by: Wei Yongjun Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.ap

Re: [PATCH v2 2/2] crypto: qat - fix resource release omissions

2016-09-13 Thread Herbert Xu
On Tue, Sep 06, 2016 at 11:18:51AM +0100, Giovanni Cabiddu wrote: > > ---8<--- > Subject: [PATCH] crypto: qat - fix leak on error path > > Fix a memory leak in an error path in uc loader. > > Signed-off-by: Giovanni Cabiddu Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondo

Re: [PATCH] hwrng: amd-rng - Migrate to managed API

2016-09-13 Thread Herbert Xu
On Fri, Sep 09, 2016 at 01:28:23PM +0530, PrasannaKumar Muralidharan wrote: > Managed API eliminates error handling code, thus reduces several lines > of code. > > Signed-off-by: PrasannaKumar Muralidharan Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herb

Re: [PATCH v2] hwrng: core - Allocate memory during module init

2016-09-13 Thread Herbert Xu
On Wed, Sep 07, 2016 at 08:18:02PM +0530, PrasannaKumar Muralidharan wrote: > In core rng_buffer and rng_fillbuf is allocated in hwrng_register only > once and it is freed during module exit. This patch moves allocating > rng_buffer and rng_fillbuf from hwrng_register to rng core's init. This > avo

Re: [PATCH] hwrng: pasemi-rng - Use linux/io.h instead of asm/io.h

2016-09-13 Thread Herbert Xu
On Tue, Sep 06, 2016 at 01:58:39PM +0530, PrasannaKumar Muralidharan wrote: > Checkpatch.pl warns about usage of asm/io.h. Use linux/io.h instead. > > Signed-off-by: PrasannaKumar Muralidharan Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key:

Re: [PATCHv3 00/11] crypto: omap HW crypto fixes

2016-09-13 Thread Herbert Xu
On Thu, Aug 04, 2016 at 01:28:35PM +0300, Tero Kristo wrote: > Hi, > > This revision took quite a bit time to craft due to the rework needed > for sham buffer handling and export/import. I ended up implementing > a flush functionality for draining out the sham buffer when doing > export/import; ju

Re: hwrng: pasemi-rng - Use linux/io.h instead of asm/io.h

2016-09-13 Thread Michael Ellerman
On Tue, 2016-06-09 at 08:28:39 UTC, PrasannaKumar Muralidharan wrote: > Checkpatch.pl warns about usage of asm/io.h. Use linux/io.h instead. > > Signed-off-by: PrasannaKumar Muralidharan Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/63019f3cab99c7acd27df5a5b8 cheers -- To u

Re: algif_aead: AIO broken with more than one iocb

2016-09-13 Thread Stephan Mueller
Am Dienstag, 13. September 2016, 18:12:46 CEST schrieb Herbert Xu: Hi Herbert, > I don't think we should allow that. We should make it so that you > must start a recvmsg before you can send data for a new request. > > Remember that the async path should be identical to the sync path, > except t

Re: [PATCH v3] crypto: only call put_page on referenced and used pages

2016-09-13 Thread Stephan Mueller
Am Dienstag, 13. September 2016, 18:08:16 CEST schrieb Herbert Xu: Hi Herbert, > This patch appears to be papering over a real bug. > > The async path should be exactly the same as the sync path, except > that we don't wait for completion. So the question is why are we > getting this crash here

Crypto Fixes for 4.8

2016-09-13 Thread Herbert Xu
Hi Linus: This push fixes a bug in the cryptd code that may lead to crashes. Please pull from git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git linus Ard Biesheuvel (1): crypto: cryptd - initialize child shash_desc on import crypto/cryptd.c |9 +++-- 1 file

Re: algif_aead: AIO broken with more than one iocb

2016-09-13 Thread Herbert Xu
On Sun, Sep 11, 2016 at 04:59:19AM +0200, Stephan Mueller wrote: > Hi Herbert, > > The AIO support for algif_aead is broken when submitting more than one iocb. > The break happens in aead_recvmsg_async at the following code: > > /* ensure output buffer is sufficiently large */ >

Re: [PATCH v3] crypto: only call put_page on referenced and used pages

2016-09-13 Thread Herbert Xu
On Tue, Sep 13, 2016 at 10:18:54AM +0200, Stephan Mueller wrote: > Am Montag, 12. September 2016, 14:43:45 CEST schrieb Stephan Mueller: > > Hi Herbert, > > > Hi Herbert, > > > > after getting the AIO code working on sendmsg, tried it with vmsplice/splice > > and I get a memory corruption. Inter

Re: [RFC PATCH v1 01/28] kvm: svm: Add support for additional SVM NPF error codes

2016-09-13 Thread Borislav Petkov
On Mon, Aug 22, 2016 at 07:23:44PM -0400, Brijesh Singh wrote: > From: Tom Lendacky > > AMD hardware adds two additional bits to aid in nested page fault handling. > > Bit 32 - NPF occurred while translating the guest's final physical address > Bit 33 - NPF occurred while translating the guest p

Re: [PATCH v2 3/8] hwrng: omap - Switch to non-obsolete read API implementation

2016-09-13 Thread Herbert Xu
On Wed, Sep 07, 2016 at 05:57:38PM +0200, Romain Perier wrote: > + > +static int omap_rng_do_read(struct hwrng *rng, void *data, size_t max, > + bool wait) > { > struct omap_rng_dev *priv; > - int data, i; > > priv = (struct omap_rng_dev *)rng->priv; > >

Re: [PATCHv3 06/11] crypto: omap-des: Fix support for unequal lengths

2016-09-13 Thread Herbert Xu
On Thu, Aug 04, 2016 at 01:28:41PM +0300, Tero Kristo wrote: > From: Lokesh Vutla > > For cases where total length of an input SGs is not same as > length of the input data for encryption, omap-des driver > crashes. This happens in the case when IPsec is trying to use > omap-des driver. > > To a

[PATCH 2/2] crypto: arm64/aes-ctr: fix NULL dereference in tail processing

2016-09-13 Thread Ard Biesheuvel
The AES-CTR glue code avoids calling into the blkcipher API for the tail portion of the walk, by comparing the remainder of walk.nbytes modulo AES_BLOCK_SIZE with the residual nbytes, and jumping straight into the tail processing block if they are equal. This tail processing block checks whether nb

[PATCH 1/2] crypto: arm/aes-ctr: fix NULL dereference in tail processing

2016-09-13 Thread Ard Biesheuvel
The AES-CTR glue code avoids calling into the blkcipher API for the tail portion of the walk, by comparing the remainder of walk.nbytes modulo AES_BLOCK_SIZE with the residual nbytes, and jumping straight into the tail processing block if they are equal. This tail processing block checks whether nb

[PATCH v3] crypto: only call put_page on referenced and used pages

2016-09-13 Thread Stephan Mueller
Am Montag, 12. September 2016, 14:43:45 CEST schrieb Stephan Mueller: Hi Herbert, > Hi Herbert, > > after getting the AIO code working on sendmsg, tried it with vmsplice/splice > and I get a memory corruption. Interestingly, the stack trace is partially > garbled too. Thus, tracking this one dow

Re: Kernel panic - encryption/decryption failed when open file on Arm64

2016-09-13 Thread Ard Biesheuvel
On 13 September 2016 at 07:43, Herbert Xu wrote: > On Mon, Sep 12, 2016 at 06:40:15PM +0100, Ard Biesheuvel wrote: >> >> So to me, it seems like we should be taking the blkcipher_next_slow() >> path, which does a kmalloc() and bails with -ENOMEM if that fails. > > Indeed. This was broken a long t