]> 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)
commit9767baa232841a506b39b26d563503508507ab07
tree10324f2a435198b3486fd74db86acbf4b057c8d8
parent7682de475e97d1249b5a73722f648fe675b0f5a2
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