Bug 689559

Summary: libnl's error handling uses strerror, which is not threadsafe
Product: Red Hat Enterprise Linux 6 Reporter: Laine Stump <laine>
Component: libnlAssignee: Thomas Graf <tgraf>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1CC: kdube, rkhan, tgraf, tpelka
Target Milestone: rc   
Target Release: 6.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libnl-1.1.3-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-22 00:15:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Laine Stump 2011-03-21 19:16:04 UTC
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 Program Management 2011-03-21 19:47:48 UTC
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 Program Management 2011-07-06 01:38:17 UTC
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 12:11:38 UTC
Fixed upstream:

commit 4d7680c19c131175e2ec431de9a026230c968a7e
Author: Thomas Graf <tgraf>
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>

Comment 6 Thomas Graf 2013-02-28 13:06:10 UTC
Backported to stable branch as:

commit f571938ccabad025eebcd3d9374a869d5769852f
Author: Thomas Graf <tgraf>
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>
    (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 13:07:24 UTC
Fixed in libnl-1.1.2 upstream

Comment 9 Thomas Graf 2013-03-19 21:05:12 UTC
Fixed in libnl-1.1.3-1

Comment 13 errata-xmlrpc 2013-11-22 00:15:51 UTC
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