Bug 1236107 - p11-kit: pthread_atfork() isn't safe to use with dlopen()
Summary: p11-kit: pthread_atfork() isn't safe to use with dlopen()
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: p11-kit
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daiki Ueno
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PKCS11
TreeView+ depends on / blocked
 
Reported: 2015-06-26 14:38 UTC by Nikos Mavrogiannopoulos
Modified: 2017-11-23 10:20 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-11-23 10:20:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Nikos Mavrogiannopoulos 2015-06-26 14:38:25 UTC
Description of problem:
p11-kit relies on pthread_atfork() to detect the current forkid. However, that function is broken and there are systems where an application will crash when that interface is used over dlopen().

Scenario (copied from [0]):

    application A loads libp11
    libp11 uses pthread_atfork() to register a handler
    application A uses PKCS#11 with no problem
    application A unloads libp11
    application A calls fork()
        handler is called but the code is no more present in memory => crash


There is an open bug about this posix function:
http://austingroupbugs.net/view.php?id=851


An alternative:
https://refspecs.linuxfoundation.org/LSB_2.0.0/LSB-Core/LSB-Core/baselib--register-atfork.html

[0]. https://github.com/OpenSC/libp11/pull/21

Comment 1 Fedora End Of Life 2016-07-19 15:04:07 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 2 Jan Kurik 2016-07-26 05:05:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 3 Fedora End Of Life 2017-02-28 09:45:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 4 Fedora Admin XMLRPC Client 2017-04-26 13:56:40 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Nikos Mavrogiannopoulos 2017-11-23 10:20:52 UTC
According to https://bugzilla.redhat.com/show_bug.cgi?id=985492 , this seems to be already addressed.


Note You need to log in before you can comment on or make changes to this bug.