Bug 507903 - m2crypto's OpenSSL locking callback does a sem_trywait() instead of sem_wait ()
Summary: m2crypto's OpenSSL locking callback does a sem_trywait() instead of sem_wait ()
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: m2crypto
Version: 5.4
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Miloslav Trmač
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks: 507787 5.4, TechnicalNotes
TreeView+ depends on / blocked
 
Reported: 2009-06-24 16:49 UTC by Miloslav Trmač
Modified: 2010-03-14 21:29 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
the OpenSSL locking callback in M2Crypto did not block on a lock when the lock was held by another thread. This could cause data corruption in multi-threaded applications. The locking callback now functions correctly, regardless of which thread holds the lock.
Clone Of:
Environment:
Last Closed: 2009-09-02 11:20:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Test case (786 bytes, text/x-csrc)
2009-06-24 16:49 UTC, Miloslav Trmač
no flags Details
Patch against upstream svn (549 bytes, patch)
2009-06-24 16:50 UTC, Miloslav Trmač
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1351 0 normal SHIPPED_LIVE m2crypto bug fix update 2009-09-01 10:49:36 UTC

Description Miloslav Trmač 2009-06-24 16:49:43 UTC
Created attachment 349275 [details]
Test case

threading_locking_callback() in m2crypto does not block on a lock when the lock is held by another thread.

Compile the test case with
    gcc m2crypto-threading-test.c -ldl $(pkg-config --cflags --libs openssl)
and run
    ./a.out /usr/lib64/python2.6/site-packages/M2Crypto/__m2crypto.so
(adjusting for your M2Crypto module path).  The program should block after printing "lock 3" (when attempting to lock an already locked lock), but it doesn't.

Comment 1 Miloslav Trmač 2009-06-24 16:50:43 UTC
Created attachment 349276 [details]
Patch against upstream svn

Comment 3 Miloslav Trmač 2009-06-24 17:04:05 UTC
Upstream: https://bugzilla.osafoundation.org/show_bug.cgi?id=12847

Comment 8 Ruediger Landmann 2009-08-14 01:36:37 UTC
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
the OpenSSL locking callback in M2Crypto did not block on a lock when the lock was held by another thread. This could cause data corruption in multi-threaded applications. The locking callback now functions correctly, regardless of which thread holds the lock.

Comment 9 errata-xmlrpc 2009-09-02 11:20:02 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1351.html


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