Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1065574

Summary: glibc: Race condition in malloc_info
Product: Red Hat Enterprise Linux 7 Reporter: jcfinger
Component: glibcAssignee: Florian Weimer <fweimer>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: ashankar, codonell, fweimer, jcfinger, mcermak, mnewsome, pfrankli, skolosov
Target Milestone: pre-dev-freezeKeywords: Patch, Reopened
Target Release: 7.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glibc-2.17-305.el7 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 19:08:29 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: 1710258    

Description jcfinger 2014-02-15 00:26:35 UTC
Description of problem:
Race condition in malloc_info can result SIGSEGV.

Version-Release number of selected component (if applicable):
6.5

How reproducible:
Be unlucky enough to free enough memory that an arena is released while a different thread is doing malloc_info.  Time it right and you lose.

Steps to Reproduce:
1.
2.
3.

Actual results:
SIGSEGV, core

Expected results:
accurate results back from malloc_info

Additional info:
From looking at the code, the "mi_arena" function nested inside of malloc_info calls 'mutex_unlock (&ar_ptr->mutex);' but then several lines down starts looking in arenas again.  My particular core file died on line

	fprintf (fp,
		 "<aspace type=\"total\" size=\"%zu\"/>\n"
		 "<aspace type=\"mprotect\" size=\"%zu\"/>\n",
		 heap->size, heap->mprotect_size);

The *ar_ptr looked good.  But *heap was not in accessible memory.  "info file" showed that the memory was no longer mapped.  But 0x8000000 beyond its address still existed.

I don't grok the malloc code, but it seems that maybe the mutex shouldn't have been released yet.

I can provide details from the core if you want.  I cannot provide the actual core as it contains private information.

Comment 7 Florian Weimer 2017-11-08 09:04:05 UTC
Red Hat Enterprise Linux 6 transitioned to the Production 3 Phase on May 10, 2017.  During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

This issue does not qualify, but we will consider incorporating an upstream change into Red Hat Enterprise Linux 7 if it becomes available.

Comment 8 Red Hat Bugzilla Rules Engine 2017-11-08 09:04:11 UTC
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.

Comment 10 Florian Weimer 2017-11-09 11:03:10 UTC
Upstream patch posted for review:

https://sourceware.org/ml/libc-alpha/2017-11/msg00312.html

Comment 18 Sergey Kolosov 2019-11-18 12:42:28 UTC
Verified with tst-malloc_info

Comment 20 errata-xmlrpc 2020-03-31 19:08:29 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.

https://access.redhat.com/errata/RHBA-2020:0989