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 1232702 - gperftools: tcmalloc debug version uses hard-coded path /tmp/google.alloc
Summary: gperftools: tcmalloc debug version uses hard-coded path /tmp/google.alloc
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gperftools
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1227837
TreeView+ depends on / blocked
 
Reported: 2015-06-17 10:54 UTC by Florian Weimer
Modified: 2015-11-19 09:32 UTC (History)
9 users (show)

Fixed In Version: gperftools-2.4-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 09:32:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2015:2293 0 normal SHIPPED_LIVE new packages: gperftools 2015-11-19 09:43:40 UTC

Description Florian Weimer 2015-06-17 10:54:39 UTC
The debug version of tcmalloc opens a hard-coded file in /tmp.  Arguably, this is not a vulnerability because it just affects debugging, but we should still fix this before shipping gperftools.


// Return the file descriptor we're writing a log to
static int TraceFd() {
  static int trace_fd = -1;
  if (trace_fd == -1) {            // Open the trace file on the first call
    trace_fd = open("/tmp/google.alloc", O_CREAT|O_TRUNC|O_WRONLY, 0666);
    if (trace_fd == -1) {
      trace_fd = 2;
      TracePrintf(trace_fd,
                  "Can't open /tmp/google.alloc.  Logging to stderr.\n");
    }
…

Comment 4 Yanhui Ma 2015-09-06 07:02:02 UTC
I checked the gperftools/gperftools-2.4/src/debugallocation.cc in both  gperftools-2.4-1 and gperftools-2.4-2.
The output is the same as comment 0:

// Return the file descriptor we're writing a log to
 955 static int TraceFd() {
 956   static int trace_fd = -1;
 957   if (trace_fd == -1) {            // Open the trace file on the first call
 958     trace_fd = open("/tmp/google.alloc", O_CREAT|O_TRUNC|O_WRONLY, 0666);
 959     if (trace_fd == -1) {
 960       trace_fd = 2;
 961       TracePrintf(trace_fd,
 962                   "Can't open /tmp/google.alloc.  Logging to stderr.\n");
 963     }
...


Is it the correct results?

Comment 5 Paolo Bonzini 2015-09-16 16:46:45 UTC
Are you using "rhpkg prep"?  I see the right result for gperftools-2.4-2.

Comment 14 Paolo Bonzini 2015-09-22 21:51:19 UTC
> The original reported problem still exists if the TCMALLOC_TRACE_FILE
> environment variable is not set.  I find this change rather puzzling.

The point of the change is just to let multiple users do their own debugging without stumbling on someone else's /tmp/google.alloc, by either specifying TCMALLOC_TRACE_FILE or falling back to stderr.  I didn't treat it as a vulnerability, just as a bug that occurs whenever /tmp/google.alloc exists and is owned by someone else.

Comment 15 juzhang 2015-09-25 02:19:28 UTC
According to comment10, comemnt11 and comment14. Set this issue as verified. Please let me know if need further testing from kvm qe side.

Best Regards,
Junyi

Comment 17 errata-xmlrpc 2015-11-19 09:32:03 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://rhn.redhat.com/errata/RHEA-2015-2293.html


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