Skip to content

Commit 12e0b15

Browse files
Ansuelherbertx
authored andcommitted
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: 9739f5f ("crypto: eip93 - Add Inside Secure SafeXcel EIP-93 crypto engine support") Reported-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 9764d5b commit 12e0b15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/crypto/inside-secure/eip93/eip93-hash.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ static int eip93_send_hash_req(struct crypto_async_request *async, u8 *data,
260260
}
261261

262262
again:
263-
ret = eip93_put_descriptor(eip93, &cdesc);
263+
scoped_guard(spinlock_irqsave, &eip93->ring->write_lock)
264+
ret = eip93_put_descriptor(eip93, &cdesc);
264265
if (ret) {
265266
usleep_range(EIP93_RING_BUSY_DELAY,
266267
EIP93_RING_BUSY_DELAY * 2);

0 commit comments

Comments
 (0)