Re: sha1_mb broken

2016-09-28 Thread Stephan Mueller
Am Mittwoch, 28. September 2016, 22:52:46 CEST schrieb Dey, Megha: Hi Megha, see a self contained example code attached. Ciao Stephan sha1_mb.tar.xz Description: application/xz-compressed-tar

RE: sha1_mb broken

2016-09-28 Thread Dey, Megha
-Original Message- From: Stephan Mueller [mailto:smuel...@chronox.de] Sent: Wednesday, September 28, 2016 11:46 AM To: Dey, Megha Cc: linux-crypto@vger.kernel.org; tim.c.c...@linux.intel.com Subject: Re: sha1_mb broken Am Mittwoch, 28. September 2016, 11:25:47 CEST schrieb Megha Dey:

Re: [PATCH 0/3] Fix crypto/vmx/p8_ghash memory corruption

2016-09-28 Thread Anton Blanchard
Hi Marcelo > This series fixes the memory corruption found by Jan Stancek in > 4.8-rc7. The problem however also affects previous versions of the > driver. If it affects previous versions, please add the lines in the sign off to get it into the stable kernels. Anton -- To unsubscribe from this l

Re: sha1_mb broken

2016-09-28 Thread Stephan Mueller
Am Mittwoch, 28. September 2016, 11:25:47 CEST schrieb Megha Dey: Hi Megha, > Hi Stephan, > > There was a bug fix: Commit ID : 0851561d (introduced in 4.6-rc5). I use the current cryptodev-2.6 tree. > > Assuming that you are using an older kernel than this one, maybe we are > issuing the compl

Re: sha1_mb broken

2016-09-28 Thread Megha Dey
Hi Stephan, There was a bug fix: Commit ID : 0851561d (introduced in 4.6-rc5). Assuming that you are using an older kernel than this one, maybe we are issuing the complete with the wrong pointer, so the original issuer of the request never gets the complete back. If you are using an older kernel

Re: sha1_mb broken

2016-09-28 Thread Megha Dey
Hi Stephan, Could you give me more info on how I could reproduce this issue on my end? Also was this issue there all along? Which is the first kernel version where you see this? Thanks, Megha On Mon, 2016-09-26 at 19:32 +0200, Stephan Mueller wrote: > Am Freitag, 26. August 2016, 03:15:06 CEST

[PATCH 1/2] crypto: ccp - data structure cleanup

2016-09-28 Thread Gary R Hook
Change names of data structure instances; add const keyword where appropriate. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c |2 +- drivers/crypto/ccp/ccp-dev-v5.c |7 +-- drivers/crypto/ccp/ccp-dev.h|6 +++--- drivers/crypto/ccp/ccp-pci.c|4 ++-- 4 f

[PATCH v2 2/2] crypto: ccp - Make syslog errors human-readable

2016-09-28 Thread Gary R Hook
Add human-readable strings to log messages about CCP errors Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c |3 ++ drivers/crypto/ccp/ccp-dev-v5.c |3 ++ drivers/crypto/ccp/ccp-dev.c| 53 +++ drivers/crypto/ccp/ccp-dev.h|2

[PATCH v2 0/2] Minor CCP driver changes

2016-09-28 Thread Gary R Hook
V2: point a goto statement at the correct label The following series is for miscellaneous small changes. --- Gary R Hook (2): crypto: ccp - clean up data structure crypto: ccp - Make syslog errors human-readable drivers/crypto/ccp/ccp-dev-v3.c |5 +++- drivers/crypto/ccp/ccp-

[PATCH v2 1/2] crypto: ccp - clean up data structure

2016-09-28 Thread Gary R Hook
Change names of data structure instances. Add const keyword where appropriate. Add error handling path. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c |2 +- drivers/crypto/ccp/ccp-dev-v5.c |9 ++--- drivers/crypto/ccp/ccp-dev.h|6 +++--- drivers/crypto/ccp/

[PATCH 1/3] crypto: ghash-generic - move common definitions to a new header file

2016-09-28 Thread Marcelo Cerri
Move common values and types used by ghash-generic to a new header file so drivers can directly use ghash-generic as a fallback implementation. Signed-off-by: Marcelo Cerri --- crypto/ghash-generic.c | 13 + include/crypto/ghash.h | 23 +++ 2 files changed, 24 ins

[PATCH 3/3] crypto: vmx - Ensure ghash-generic is enabled

2016-09-28 Thread Marcelo Cerri
Add CRYPTO_GHASH as a dependency for vmx_crypto since p8_ghash uses it as the fallback implementation. Signed-off-by: Marcelo Cerri --- drivers/crypto/vmx/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/vmx/Kconfig b/drivers/crypto/vmx/Kconfig index a83

[PATCH 0/3] Fix crypto/vmx/p8_ghash memory corruption

2016-09-28 Thread Marcelo Cerri
This series fixes the memory corruption found by Jan Stancek in 4.8-rc7. The problem however also affects previous versions of the driver. Marcelo Cerri (3): crypto: ghash-generic - move common definitions to a new header file crypto: vmx - Fix memory corruption caused by p8_ghash crypto: vm

[PATCH 2/3] crypto: vmx - Fix memory corruption caused by p8_ghash

2016-09-28 Thread Marcelo Cerri
This patch changes the p8_ghash driver to use ghash-generic as a fixed fallback implementation. This allows the correct value of descsize to be defined directly in its shash_alg structure and avoids problems with incorrect buffer sizes when its state is exported or imported. Reported-by: Jan Stanc

Re: [PATCH 1/2] crypto: ccp - data structure cleanup

2016-09-28 Thread Tom Lendacky
On 09/28/2016 10:49 AM, Gary R Hook wrote: > Change names of data structure instances; add const > keyword where appropriate. > > Signed-off-by: Gary R Hook > --- > drivers/crypto/ccp/ccp-dev-v3.c |2 +- > drivers/crypto/ccp/ccp-dev-v5.c |7 +-- > drivers/crypto/ccp/ccp-dev.h|

[PATCH 2/2] crypto: ccp - Improve info reported when an error occurs

2016-09-28 Thread Gary R Hook
Add human readable strings to log messages about CCP errors Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c |3 ++ drivers/crypto/ccp/ccp-dev-v5.c |3 ++ drivers/crypto/ccp/ccp-dev.c| 53 +++ drivers/crypto/ccp/ccp-dev.h|2

[PATCH] crypto: testmgr - add guard to dst buffer for ahash_export

2016-09-28 Thread Jan Stancek
Add a guard to 'state' buffer and warn if its consistency after call to crypto_ahash_export() changes, so that any write that goes beyond advertised statesize (and thus causing potential memory corruption [1]) is more visible. [1] https://marc.info/?l=linux-crypto-vger&m=147467656516085 Signed-of

Re: [PATCH] crypto: sha1-powerpc: little-endian support

2016-09-28 Thread Marcelo Cerri
On Wed, Sep 28, 2016 at 09:20:15PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 10:15:51AM -0300, Marcelo Cerri wrote: > > Hi Herbert, > > > > Any thoughts on this one? > > Can this patch wait until the next merge window? On the broken > platforms it should just fail the self-test, right?

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Paulo Flabiano Smorigo
Wed, Sep 28, 2016 at 08:33:18PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 09:28:44AM -0300, Marcelo Cerri wrote: > > > > The big difference between p8_ghash and padlock_sha1 is that > > padlock_sha1 defines alg->statesize as sizeof(struct sha1_state), which > > is the descsize value used b

Re: [PATCH] crypto: sha1-powerpc: little-endian support

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 10:15:51AM -0300, Marcelo Cerri wrote: > Hi Herbert, > > Any thoughts on this one? Can this patch wait until the next merge window? On the broken platforms it should just fail the self-test, right? Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herb

Re: [PATCH] crypto: sha1-powerpc: little-endian support

2016-09-28 Thread Marcelo Cerri
Hi Herbert, Any thoughts on this one? -- Regards, Marcelo On Fri, Sep 23, 2016 at 04:31:56PM -0300, Marcelo Cerri wrote: > The driver does not handle endianness properly when loading the input > data. > > Signed-off-by: Marcelo Cerri > --- > arch/powerpc/crypto/sha1-powerpc-asm.S | 13 ++

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 09:55:58AM -0300, Marcelo Cerri wrote: > > Great! If we check the descsize every time a fallback tfm is allocated > that should be enough to prevent bigger problems such as memory > corruptions. Yes a check wouldn't hurt. > Can I move ghash_desc_ctx to a header file unde

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Marcelo Cerri
On Wed, Sep 28, 2016 at 08:44:52PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 09:38:41AM -0300, Marcelo Cerri wrote: > > > > The patch forces ghash-generic as the fallback. And I don't think that > > is a big problem if we decide to go by this path. > > Right it should work but could brea

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 09:38:41AM -0300, Marcelo Cerri wrote: > > The patch forces ghash-generic as the fallback. And I don't think that > is a big problem if we decide to go by this path. Right it should work but could break for example if we ever decide to change the exported state structure f

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Marcelo Cerri
Hi Hebert, On Wed, Sep 28, 2016 at 08:29:35PM +0800, Herbert Xu wrote: > On Wed, Sep 28, 2016 at 03:40:51AM -0400, Jan Stancek wrote: > > > > Thanks for clearing up how this works in padlock-sha, but > > we are not exactly in same situation with p8_ghash. > > > > p8_ghash_init_tfm() already upda

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 09:28:44AM -0300, Marcelo Cerri wrote: > > The big difference between p8_ghash and padlock_sha1 is that > padlock_sha1 defines alg->statesize as sizeof(struct sha1_state), which > is the descsize value used by sha1_generic. This probably works but > it's also wrong because t

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Herbert Xu
On Wed, Sep 28, 2016 at 03:40:51AM -0400, Jan Stancek wrote: > > Thanks for clearing up how this works in padlock-sha, but > we are not exactly in same situation with p8_ghash. > > p8_ghash_init_tfm() already updates descsize. Problem in original report > is that without custom export/import/stat

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Marcelo Cerri
Hi Herbert, On Wed, Sep 28, 2016 at 10:45:49AM +0800, Herbert Xu wrote: > On Tue, Sep 27, 2016 at 04:46:44PM -0300, Marcelo Cerri wrote: > > > > Can you check if the problem occurs with this patch? > > In light of the fact that padlock-sha is the correct example > to follow, you only need to add o

[PATCH] crypto/caam/jr : Unmap region obtained by of_iomap

2016-09-28 Thread Arvind Yadav
From: Arvind Yadav Free memory mapping, if probe is not successful. Signed-off-by: Arvind Yadav --- drivers/crypto/caam/jr.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index a81f551..9e7f281 100644 --- a/drivers/crypto/caam/jr.c +

Re: [2/2] ath9k: disable RNG by default

2016-09-28 Thread Kalle Valo
miaoqing pan wrote: > From: Miaoqing Pan > > ath9k RNG will dominates all the noise sources from the real HW > RNG, disable it by default. But we strongly recommand to enable > it if the system without HW RNG, especially on embedded systems. > > Signed-off-by: Miaoqing Pan > Acked-by: Stephan

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Jan Stancek
> Jan, > > Can you check if the problem occurs with this patch? No issues in over-night test with this patch. > --- a/drivers/crypto/vmx/vmx.c > +++ b/drivers/crypto/vmx/vmx.c > @@ -28,6 +28,8 @@ > #include > #include > > +int p8_ghash_fallback_descsize(void); > + > extern struct shash_al

Re: [bug] crypto/vmx/p8_ghash memory corruption in 4.8-rc7

2016-09-28 Thread Jan Stancek
- Original Message - > From: "Herbert Xu" > To: "Marcelo Cerri" > Cc: "Jan Stancek" , "rui y wang" , > mhce...@linux.vnet.ibm.com, > leosi...@linux.vnet.ibm.com, pfsmor...@linux.vnet.ibm.com, > linux-crypto@vger.kernel.org, > linuxppc-...@lists.ozlabs.org, linux-ker...@vger.kernel.o