Bug 689559 - libnl's error handling uses strerror, which is not threadsafe
libnl's error handling uses strerror, which is not threadsafe
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libnl (Show other bugs)
6.1
Unspecified Unspecified
unspecified Severity unspecified
: rc
: 6.5
Assigned To: Thomas Graf
Desktop QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-21 15:16 EDT by Laine Stump
Modified: 2013-11-21 19:15 EST (History)
4 users (show)

See Also:
Fixed In Version: libnl-1.1.3-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 19:15:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Laine Stump 2011-03-21 15:16:04 EDT
libnl's error handling makes generous use of strerror(), but strerror is not threadsafe, and it's totally acceptable for multiple threads in an application to call libnl.

All the occurences of strerror should be replaced with a call to strerror_r that puts the message into a thread-local static buffer.
Comment 2 RHEL Product and Program Management 2011-03-21 15:47:48 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.
Comment 4 RHEL Product and Program Management 2011-07-05 21:38:17 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.
Comment 5 Thomas Graf 2013-02-28 07:11:38 EST
Fixed upstream:

commit 4d7680c19c131175e2ec431de9a026230c968a7e
Author: Thomas Graf <tgraf@suug.ch>
Date:   Thu Feb 28 13:07:04 2013 +0100

    Use thread-safe strerror_r() instead of strerror()
    
    We have only ever fed well known error codes into strerror()
    so it should never have been a problem though.
    
    Signed-off-by: Thomas Graf <tgraf@suug.ch>
Comment 6 Thomas Graf 2013-02-28 08:06:10 EST
Backported to stable branch as:

commit f571938ccabad025eebcd3d9374a869d5769852f
Author: Thomas Graf <tgraf@suug.ch>
Date:   Thu Feb 28 13:07:04 2013 +0100

    Use thread-safe strerror_r() instead of strerror()
    
    We have only ever fed well known error codes into strerror()
    so it should never have been a problem though.
    
    Signed-off-by: Thomas Graf <tgraf@suug.ch>
    (cherry picked from commit 4d7680c19c131175e2ec431de9a026230c968a7e)
    
    Conflicts:
        lib/fib_lookup/lookup.c
        lib/msg.c
        lib/route/route_obj.c
        src/lib/utils.c
Comment 7 Thomas Graf 2013-02-28 08:07:24 EST
Fixed in libnl-1.1.2 upstream
Comment 9 Thomas Graf 2013-03-19 17:05:12 EDT
Fixed in libnl-1.1.3-1
Comment 13 errata-xmlrpc 2013-11-21 19:15:51 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1730.html

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