crypto: s390 - fix des and des3_ede ctr concurrency issue
authorHarald Freudenberger <freude@linux.vnet.ibm.com>
Wed, 22 Jan 2014 12:01:33 +0000 (13:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Feb 2014 19:07:58 +0000 (11:07 -0800)
commit9d5e3b525d415308035071a009e0353d11d5c0ce
tree95d4b64870bcf61456b524b8d55be9f853be7b95
parent6414e5ed784678a379e0f4afb023f9cc643e1b33
crypto: s390 - fix des and des3_ede ctr concurrency issue

commit ee97dc7db4cbda33e4241c2d85b42d1835bc8a35 upstream.

In s390 des and 3des ctr mode there is one preallocated page
used to speed up the en/decryption. This page is not protected
against concurrent usage and thus there is a potential of data
corruption with multiple threads.

The fix introduces locking/unlocking the ctr page and a slower
fallback solution at concurrency situations.

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/crypto/des_s390.c