crypto: api - Do not zap spawn->alg

Currently when a spawn is removed we will zap its alg field.
This is racy because the spawn could belong to an unregistered
instance which may dereference the spawn->alg field.

This patch fixes this by keeping spawn->alg constant and instead
adding a new spawn->dead field to indicate that a spawn is going
away.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Herbert Xu
2019-12-07 22:15:17 +08:00
parent 73669cc556
commit 4f87ee118d
2 changed files with 14 additions and 11 deletions

View File

@@ -70,6 +70,7 @@ struct crypto_spawn {
struct crypto_instance *inst;
const struct crypto_type *frontend;
u32 mask;
bool dead;
};
struct crypto_queue {