[PATCH 3/4] crypto: talitos - fix aead sglen for case 'dst != src'

2013-11-28 Thread Horia Geanta
For aead case when source and destination buffers are different, there is an incorrect assumption that the source length includes the ICV length. Fix this, since it leads to an oops when using sg_count() to find the number of nents in the scatterlist: Unable to handle kernel paging request for

[PATCH 4/4] crypto: testmgr - fix sglen in test_aead for case 'dst != src'

2013-11-28 Thread Horia Geanta
Commit d8a32ac25698cd60b02bed2100379803c7f964e3 (crypto: testmgr - make test_aead also test 'dst != src' code paths) added support for different source and destination buffers in test_aead. This patch modifies the source and destination buffer lengths accordingly: the lengths are not equal since

Re: [PATCH] crypto: fix potential NULL pointer dereference in skcipher_alloc_sgl()

2013-11-28 Thread Herbert Xu
On Fri, Nov 15, 2013 at 10:31:25AM +0800, Jeff Liu wrote: From: Jie Liu jeff@oracle.com In skcipher_alloc_sgl(), there is a potential null pointer dereference issue to retrieve the last item from ctx-tsgl list if the list is empty. This patch fix it by checking if the list is empty or

Re: [PATCH] s390/crypto: fix aes ctr concurrency issue

2013-11-28 Thread Herbert Xu
On Tue, Nov 19, 2013 at 11:22:12AM +0100, Harald Freudenberger wrote: The aes-ctr mode used one preallocated page without any concurrency protection. When multiple threads run aes-ctr encryption or decryption this could lead to data corruption. The patch introduces locking for the

Re: [PATCH 02/10] crypto: scatterwalk - Set the chain pointer indication bit

2013-11-28 Thread Herbert Xu
On Tue, Nov 12, 2013 at 11:46:10AM -0600, Tom Lendacky wrote: The scatterwalk_crypto_chain function invokes the scatterwalk_sg_chain function to chain two scatterlists, but the chain pointer indication bit is not set. When the resulting scatterlist is used, for example, by sg_nents to count

Re: [PATCH] crypto: talitos - corrrectly handle zero-length assoc data

2013-11-28 Thread Herbert Xu
On Tue, Nov 19, 2013 at 02:57:49PM +0200, Horia Geanta wrote: talitos does not handle well zero-length assoc data. From dmesg: talitos ffe3.crypto: master data transfer error talitos ffe3.crypto: gather return/length error Check whether assoc data is provided by inspecting assoclen,

Re: [PATCH 1/4] crypto: ccm - Fix handling of zero plaintext when computing mac

2013-11-28 Thread Herbert Xu
On Thu, Nov 28, 2013 at 03:11:15PM +0200, Horia Geanta wrote: There are cases when cryptlen can be zero in crypto_ccm_auth(): -encryptiom: input scatterlist length is zero (no plaintext) -decryption: input scatterlist contains only the mac plus the condition of having different source and

Re: [PATCH] crypto: s390 - Fix aes-xts parameter corruption

2013-11-28 Thread Herbert Xu
On Fri, Nov 22, 2013 at 02:57:56PM +0100, Gerald Schaefer wrote: On Tue, 19 Nov 2013 17:12:47 +0100 Gerald Schaefer gerald.schae...@de.ibm.com wrote: Some s390 crypto algorithms incorrectly use the crypto_tfm structure to store private data. As the tfm can be shared among multiple

Re: [PATCH] s390/crypto: fix aes ctr concurrency issue

2013-11-28 Thread Harald Freudenberger
On Thu, 2013-11-28 at 22:00 +0800, Herbert Xu wrote: On Tue, Nov 19, 2013 at 11:22:12AM +0100, Harald Freudenberger wrote: The aes-ctr mode used one preallocated page without any concurrency protection. When multiple threads run aes-ctr encryption or decryption this could lead to data

[PATCH] crypto: remove unnecessary includes

2013-11-28 Thread Cristian Stoica
Signed-off-by: Cristian Stoica cristian.sto...@freescale.com --- crypto/authenc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/crypto/authenc.c b/crypto/authenc.c index 1875e70..7d4bfaa 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c @@ -17,11 +17,8 @@ #include crypto/scatterwalk.h

[PATCH] crypto: AF_ALG: Check for MSG_SENDPAGE_NOTLAST

2013-11-28 Thread Richard Weinberger
Commit 35f9c09fe (tcp: tcp_sendpages() should call tcp_push() once) added an internal flag MSG_SENDPAGE_NOTLAST. We have to check for MSG_SENDPAGE_NOTLAST too to find out whether more data is available. Cc: Tom Herbert therb...@google.com Cc: Eric Dumazet eric.duma...@gmail.com Cc: David S.

[PATCH 2/2] padata: Fix wrong usage of rcu_dereference()

2013-11-28 Thread Mathias Krause
A kernel with enabled lockdep complains about the wrong usage of rcu_dereference() under a rcu_read_lock_bh() protected region. === [ INFO: suspicious RCU usage. ] 3.13.0-rc1+ #126 Not tainted --- linux/kernel/padata.c:115

[PATCH 1/2] crypto: pcrypt - Fix wrong usage of rcu_dereference()

2013-11-28 Thread Mathias Krause
A kernel with enabled lockdep complains about the wrong usage of rcu_dereference() under a rcu_read_lock_bh() protected region. === [ INFO: suspicious RCU usage. ] 3.13.0-rc1+ #126 Not tainted --- linux/crypto/pcrypt.c:81

[PATCH 0/2] pcrypt/padata rcu fixes

2013-11-28 Thread Mathias Krause
Two small RCU related fixes, lockdep complained about. Please apply! Mathias Krause (2): crypto: pcrypt - Fix wrong usage of rcu_dereference() padata: Fix wrong usage of rcu_dereference() crypto/pcrypt.c |2 +- kernel/padata.c |2 +- 2 files changed, 2 insertions(+), 2

Re: [PATCH] s390/crypto: fix aes ctr concurrency issue

2013-11-28 Thread Herbert Xu
On Thu, Nov 28, 2013 at 04:39:43PM +0100, Harald Freudenberger wrote: You can't use mutex_lock because you may be in a non-sleepable context. Perhaps just fall back to doing it block-by-block, like we do in aesni-intel on x86? The first attempt to lock the mutex is done with

Re: [PATCH] crypto: remove unnecessary includes

2013-11-28 Thread Herbert Xu
On Thu, Nov 28, 2013 at 07:16:27PM +0200, Cristian Stoica wrote: Signed-off-by: Cristian Stoica cristian.sto...@freescale.com --- crypto/authenc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/crypto/authenc.c b/crypto/authenc.c index 1875e70..7d4bfaa 100644 --- a/crypto/authenc.c

Re: [PATCH] update consumers of MSG_MORE to recognize MSG_SENDPAGE_NOTLAST

2013-11-28 Thread Hannes Frederic Sowa
On Sun, Nov 24, 2013 at 10:36:28PM -0800, Shawn Landden wrote: Commit 35f9c09fe (tcp: tcp_sendpages() should call tcp_push() once) added an internal flag MSG_SENDPAGE_NOTLAST, similar to MSG_MORE. algif_hash, algif_skcipher, and udp used MSG_MORE from tcp_sendpages() and need to see the new