Bug 74919 - Callers of proxy module can crash if in PKCS#11 when C_Finalize is called
Summary: Callers of proxy module can crash if in PKCS#11 when C_Finalize is called
Status: RESOLVED FIXED
Alias: None
Product: p11-glue
Classification: Unclassified
Component: p11-kit (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Stef Walter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-13 08:57 UTC by Stef Walter
Modified: 2014-02-13 11:12 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
proxy: Fix cases where modules are unloaded while in use (3.43 KB, patch)
2014-02-13 08:57 UTC, Stef Walter
Details | Splinter Review
proxy: Remove assertions when module is not initialized (914 bytes, patch)
2014-02-13 09:00 UTC, Stef Walter
Details | Splinter Review

Description Stef Walter 2014-02-13 08:57:01 UTC
The proxy module would unload the PKCS#11 modules it was proxying when  C_Finalize() was called. However if a caller in another thread was inside of a PKCS#11 function at the time, this would cause a crash.
Comment 1 Stef Walter 2014-02-13 08:57:32 UTC
Created attachment 93991 [details] [review]
proxy: Fix cases where modules are unloaded while in use

The proxy module would unload the PKCS#11 modules it was proxying
when C_Finalize() was called. However if a caller in another thread
was inside of a PKCS#11 function at the time, this would cause
a crash.

Change things around so that underlying modules are finalized during
the proxy C_Finalize() but not released/unloaded until the proxy
module itself is unloaded.
Comment 2 Stef Walter 2014-02-13 09:00:10 UTC
Created attachment 93992 [details] [review]
proxy: Remove assertions when module is not initialized

We should return CKR_CRYPTOKI_NOT_INITIALIZED rather than
assert() when proxy PKCS#11 functions are called before the
module is initialized.
Comment 3 Stef Walter 2014-02-13 11:12:00 UTC
Pushed to git master ie: 0.20.x. This bug/patch is not applicable to the older 0.18.x code.
Comment 4 Stef Walter 2014-02-13 11:12:17 UTC
Tested by djasa@redhat.com here: https://bugzilla.redhat.com/show_bug.cgi?id=1060232


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.