Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset mutex callbacks to the default version when finished #409

Merged
merged 1 commit into from Aug 5, 2018

Conversation

abbra
Copy link
Contributor

@abbra abbra commented Jul 31, 2018

If a PKCS11 API caller provided own mutex handling callbacks,
we need to ensure they aren't used after C_Finalize is called
and SoftHSM instance is recycled.

Inability to do so may lead to a situation where callbacks might
be provided by a different dynamically loaded object which is removed
after C_Finalize() call. Thus, callback pointers become invalid and
calling them leads to crashes.

Fixes: #408

Signed-off-by: Alexander Bokovoy abokovoy@redhat.com

If a PKCS11 API caller provided own mutex handling callbacks,
we need to ensure they aren't used after C_Finalize is called
and SoftHSM instance is recycled.

Inability to do so may lead to a situation where callbacks might
be provided by a different dynamically loaded object which is removed
after C_Finalize() call. Thus, callback pointers become invalid and
calling them leads to crashes.

Fixes: opendnssec#408

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
@abbra
Copy link
Contributor Author

abbra commented Jul 31, 2018

I ran a few heavy tests -- installing FreeIPA -- and it succeeded with this patch. FreeIPA makes use of SoftHSMv2 for DNSSEC and also Fedora makes SoftHSMv2 tokens available via p11-kit, thus loading in all NSS tools by default. All is working now.

I'd appreciate any reaction from the upstream developers and get this patch merged. Thanks in advance!

@rijswijk
Copy link
Contributor

rijswijk commented Jul 31, 2018 via email

@bellgrim
Copy link

bellgrim commented Aug 5, 2018

Thank you for the patch! Will merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants