]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: nx - Fix SHA concurrence issue and sg limit bounds
authorLeonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
Tue, 28 Oct 2014 17:49:46 +0000 (15:49 -0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 6 Nov 2014 15:15:02 +0000 (23:15 +0800)
commit3aa98460da4ad3e0c7fda2715c29a3cac974c4b6
tree10324f2a435198b3486fd74db86acbf4b057c8d8
parentfe2efe102c61d50f4d8c177dce33811c14c9e8cf
crypto: nx - Fix SHA concurrence issue and sg limit bounds

NX SHA algorithms stores the message digest into tfm what
cause a concurrence issue where hashes may be replaced by others.
This patch cleans up the cases where it's handling unnecessarily shared
variables in nx context and copies the current msg digest to a sctx->state
in order to safetly handle with the hashe's state.

Also fixes and does some clean ups regarding the right sg max limit
and bounds to the sg list avoind a memory crash.

Signed-off-by: Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/nx/nx-sha256.c
drivers/crypto/nx/nx-sha512.c