RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1810146 - glibc: getaddrinfo: Fix resource leak after strdup failure in gethosts [BZ #25425]
Summary: glibc: getaddrinfo: Fix resource leak after strdup failure in gethosts [BZ #2...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.3
Assignee: Carlos O'Donell
QA Contact: qe-baseos-tools-bugs
Zuzana Zoubkova
URL:
Whiteboard:
Depends On: 1819986
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-04 15:43 UTC by Carlos O'Donell
Modified: 2023-07-18 14:30 UTC (History)
9 users (show)

Fixed In Version: glibc-2.28-112.el8
Doc Type: Bug Fix
Doc Text:
.`getaddrinfo` now correctly handles a memory allocation failure Previously, after a memory allocation failure, the `getaddrinfo` function of the GNU C Library `glibc` did not release the internal resolver context. As a consequence, `getaddrinfo` was not able to reload the `/etc/resolv.conf` file for the rest of the lifetime of the calling thread, resulting in a possible memory leak. This update modifies the error handling path with an additional release operation for the resolver context. As a result, `getaddrinfo` reloads `/etc/resolv.conf` with new configuration values even after an intermittent memory allocation failure.
Clone Of:
Environment:
Last Closed: 2020-11-04 01:33:21 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:4444 0 None None None 2020-11-04 01:33:42 UTC
Sourceware 25425 0 P2 RESOLVED Missing call to __resolv_context_put in getaddrinfo.c:gethosts 2021-02-18 01:00:42 UTC

Description Carlos O'Donell 2020-03-04 15:43:14 UTC
There is a resource leak in gethosts after a strdup failure. We should fix this.

No extra test provided. To verify this you have to trigger the strdup failure manually and observe the resource leaks.

https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=8b222fa38700422b4da6731806835f0bbf40920d

commit 8b222fa38700422b4da6731806835f0bbf40920d
Author: Florian Weimer <fweimer>
Date:   Mon Jan 20 18:37:13 2020 +0100

    getaddrinfo: Fix resource leak after strdup failure in gethosts [BZ #25425]
    
    Filip Ochnik spotted that one of the error jumps in gethosts fails to
    call __resolv_context_put to release the resolver context.
    
    Fixes commit 352f4ff9a268b81ef5d4b2413f582565806e4790 ("resolv:
    Introduce struct resolv_context [BZ #21668]") and commit
    964263bb8d650f1681665c55704fb01a8e725621 ("getaddrinfo: Release
    resolver context on error in gethosts [BZ #21885]").
    
    Reviewed-by: Siddhesh Poyarekar <siddhesh>

Comment 9 errata-xmlrpc 2020-11-04 01:33:21 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 (Moderate: glibc security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHSA-2020:4444


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