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:06:10 +0000 (11:06 -0800)
commit4cd88080b9faf0addc76815e38195b88e0075aea
treef930a45b3a382a938c9bf4d053c55ee0b91babf6
parent21d6cfc95cbdd193e29f55ad2fb0934ff99a9a80
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