diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2019-12-07 15:15:17 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-12-11 09:48:39 +0100 |
commit | 4f87ee118d16b4b2116a477229573ed5003b0d78 (patch) | |
tree | a57cbf2d901e3de04719901be7d194d561613a97 /include/crypto/algapi.h | |
parent | crypto: api - Fix race condition in crypto_spawn_alg (diff) | |
download | linux-4f87ee118d16b4b2116a477229573ed5003b0d78.tar.xz linux-4f87ee118d16b4b2116a477229573ed5003b0d78.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | include/crypto/algapi.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 5cd846defdd6..771a295ac755 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h @@ -70,6 +70,7 @@ struct crypto_spawn { struct crypto_instance *inst; const struct crypto_type *frontend; u32 mask; + bool dead; }; struct crypto_queue { |