]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
CRYPTO api: Fix potential race in crypto_remove_spawn
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 29 Nov 2007 12:07:57 +0000 (23:07 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 Dec 2007 17:51:04 +0000 (09:51 -0800)
commitdf70b187c9908155ba646b57797c2c6e7b426733
tree992c3c8b7c1ecf30ea6157a070c0d8cc603cad37
parent470678d9f4e37380e89999b5a4f223985cf186e1
CRYPTO api: Fix potential race in crypto_remove_spawn

[CRYPTO] api: Fix potential race in crypto_remove_spawn

[ Upstream commit: 38cb2419f544ad413c7f7aa8c17fd7377610cdd8 ]

As it is crypto_remove_spawn may try to unregister an instance which is
yet to be registered.  This patch fixes this by checking whether the
instance has been registered before attempting to remove it.

It also removes a bogus cra_destroy check in crypto_register_instance as
1) it's outside the mutex;
2) we have a check in __crypto_register_alg already.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
crypto/algapi.c