crypto: inside-secure/eip93 - acquire lock on eip93_put_descriptor hash
Subsystems (4)
Christian Marangi
maintainerPATCH 1/1 crypto: inside-secure/eip93 - acquire lock on eip93_put_descriptor hash
In the EIP93 HASH functions, the eip93_put_descriptor is called without acquiring lock. This is problematic when multiple thread execute hash operations.
Correctly acquire ring write lock on calling eip93_put_descriptor to prevent concurrent access and mess with the ring pointers.
Fixes 9739f5f93b78 ("crypto: eip93 - Add Inside Secure SafeXcel EIP-93 crypto engine support")
Reported-by Herbert Xu <[email protected]>
Signed-off-by Christian Marangi <[email protected]>
--- drivers/crypto/inside-secure/eip93/eip93-hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/crypto/inside-secure/eip93/eip93-hash.c +2 -1
@@ -260,7 +260,8 @@ static int eip93_send_hash_req(struct crypto_async_request *async, u8 *data, } again: - ret =eip93_put_descriptor (eip93, &cdesc); +scoped_guard (spinlock_irqsave, &eip93->ring->write_lock) + ret = eip93_put_descriptor(eip93, &cdesc);if (ret) {usleep_range (EIP93_RING_BUSY_DELAY ,EIP93_RING_BUSY_DELAY *2 );
Signature · 1 line
2.48.1
Herbert Xu
maintainerQuoted 7 lines · Christian Marangi
In the EIP93 HASH functions, the
eip93_put_descriptoris called without acquiring lock. This is problematic when multiple thread execute hash operations.Correctly acquire ring write lock on calling
eip93_put_descriptorto prevent concurrent access and mess with the ring pointers.
Quoted 7 lines
Fixes 9739f5f93b78 ("crypto: eip93 - Add Inside Secure SafeXcel EIP-93 crypto engine support")Reported-by Herbert Xu <[email protected]>Signed-off-by Christian Marangi <[email protected]>--- drivers/crypto/inside-secure/eip93/eip93-hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt