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:10:06 +0000 (11:10 -0800)
commite803b163dccd2762ab67b5ccd16d28f95efc38ab
treedf07ce36a55499e1dabd8f6435944c8e1fd44d96
parentdae3db4c3fa28d3182e1c8dff01392a99a3065d2
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