]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
crypto: nx - fix concurrency issue
authorMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
Mon, 12 Aug 2013 21:49:37 +0000 (18:49 -0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 14 Aug 2013 10:42:04 +0000 (20:42 +1000)
commitc849163b80c05f4567b1adef5db7f377460f88cd
treeb7e3e40e463ed921040c1049212e40132103c536
parentf22d08111a1d23f7432ee8d9c2dd637deb6963bd
crypto: nx - fix concurrency issue

The NX driver uses the transformation context to store several fields
containing data related to the state of the operations in progress.
Since a single tfm can be used by different kernel threads at the same
time, we need to protect the data stored into the context.

This patch makes use of spin locks to protect the data where a race
condition can happen.

Reviewed-by: Fionnuala Gunter <fin@linux.vnet.ibm.com>
Reviewed-by: Joy Latten <jmlatten@linux.vnet.ibm.com>
Signed-off-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/nx/nx-aes-cbc.c
drivers/crypto/nx/nx-aes-ccm.c
drivers/crypto/nx/nx-aes-ctr.c
drivers/crypto/nx/nx-aes-ecb.c
drivers/crypto/nx/nx-aes-gcm.c
drivers/crypto/nx/nx-aes-xcbc.c
drivers/crypto/nx/nx-sha256.c
drivers/crypto/nx/nx-sha512.c
drivers/crypto/nx/nx.c
drivers/crypto/nx/nx.h