Bug 1236107

Summary: p11-kit: pthread_atfork() isn't safe to use with dlopen()
Product: [Fedora] Fedora Reporter: Nikos Mavrogiannopoulos <nmavrogi>
Component: p11-kitAssignee: Daiki Ueno <dueno>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: kengert, mpreisle, stefw, tmraz
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-23 10:20:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1173546    

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.