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 1441098

Summary: rpmbuild might create world writeable /usr/src/debug/tmp directory in debuginfo packages
Product: Red Hat Enterprise Linux 7 Reporter: Mark Wielaard <mjw>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Jan Blazek <jblazek>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: ffesti, vmukhame
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 15:58:38 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: 1465896, 1466368    

Description Mark Wielaard 2017-04-11 08:27:54 UTC
rpm used to have a bug that caused it to sometimes add a world writeable directory to a debuginfo package. Specifically if a (generated) source file was found in /tmp it would add /usr/src/debug/tmp to the debuginfo package. The directory would have the same mode as /tmp:

drwxrwxrwt. 2 root root 6 Aug  2  2016 /usr/src/debug/tmp

A fix is already upstream:

commit c707ab26362e795d3f9dba4eb87dc7ed99a28bcb
Author: Robin Lee <cheeselee>
Date:   Sat Apr 8 21:21:39 2017 +0800

    Fix non-standard inherented modes of directories in debuginfo
    
    In case that binary compiled from source generated in /tmp, a
    /usr/src/debug/tmp directory will be created with the same mode as
    /tmp, a.k.a 777, which should be avoided.
    
    Fixes: rhbz#641022

This impacts at last the following packages in RHEL 7.3 (x86_64):

dhcp-debuginfo-4.2.5-47.el7.x86_64.rpm
glib2-debuginfo-2.46.2-4.el7.x86_64.rpm
libmemcached-debuginfo-1.0.16-5.el7.x86_64.rpm
libvirt-debuginfo-2.0.0-10.el7.x86_64.rpm
mariadb-debuginfo-5.5.52-1.el7.x86_64.rpm
pcp-debuginfo-3.11.3-4.el7.x86_64.rpm
perl-debuginfo-5.16.3-291.el7.x86_64.rpm
postgresql-debuginfo-9.2.18-1.el7.x86_64.rpm
python-debuginfo-2.7.5-48.el7.x86_64.rpm
qemu-guest-agent-debuginfo-2.5.0-3.el7.x86_64.rpm
qemu-kvm-debuginfo-1.5.3-126.el7.x86_64.rpm
ruby-debuginfo-2.0.0.648-29.el7.x86_64.rpm
sssd-debuginfo-1.14.0-43.el7.x86_64.rpm
tcl-debuginfo-8.5.13-8.el7.x86_64.rpm

Once the fix is backported it would be nice to rebuild at least the above debuginfo packages.

As a special case it might make sense to explicitly remove /usr/src/debug/tmp from a package if it is empty (in general empty directories under /usr/src/debug/<package-nvr>/ are a feature, not a bug). When multiple packages contain the same directory  they will conflict when the directory has different modes in different packages.

Comment 2 Mark Wielaard 2017-04-25 20:26:48 UTC
See also https://bugzilla.redhat.com/show_bug.cgi?id=641022 the rpm-4.13.x-writable-tmp-dir.patch backport for f26 should apply to rhel too.

Comment 8 errata-xmlrpc 2018-04-10 15:58:38 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-2018:0877