diff options
author | Dan McDonald <danmcd@omniti.com> | 2014-06-05 00:43:20 -0400 |
---|---|---|
committer | Dan McDonald <danmcd@omniti.com> | 2014-06-06 14:58:03 -0400 |
commit | 05d57413471eaaa425913a06edc2ab33ad9b05bc (patch) | |
tree | bbef725146e3c7af7a81e951f1c3a97a5ed6a016 /usr/src/lib/pkcs11/pkcs11_softtoken/common | |
parent | 06315b795c0d54f0228e0b8af497a28752dd92da (diff) | |
download | illumos-gate-05d57413471eaaa425913a06edc2ab33ad9b05bc.tar.gz |
1667 pkcs11 may deadlock when multi-threaded consumers fork
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
Approved by: Gordon Ross <gordon.ross@nexenta.com>
Diffstat (limited to 'usr/src/lib/pkcs11/pkcs11_softtoken/common')
-rw-r--r-- | usr/src/lib/pkcs11/pkcs11_softtoken/common/softGeneral.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softGeneral.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softGeneral.c index 396a3c5bf4..c44cbcb2a2 100644 --- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softGeneral.c +++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softGeneral.c @@ -21,6 +21,8 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved. */ #include <strings.h> @@ -354,9 +356,12 @@ finalize_common(boolean_t force, CK_VOID_PTR pReserved) { softtoken_initialized = B_FALSE; softtoken_pid = 0; - pkcs11_close_urandom(); - pkcs11_close_urandom_seed(); - pkcs11_close_random(); + /* + * There used to be calls to cleanup libcryptoutil here. Given that + * libcryptoutil can be linked and invoked independently of PKCS#11, + * cleaning up libcryptoutil here makes no sense. Decoupling these + * two also prevent deadlocks and other artificial dependencies. + */ /* Destroy the session list lock here */ (void) pthread_mutex_destroy(&soft_sessionlist_mutex); |