Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1441098 - rpmbuild might create world writeable /usr/src/debug/tmp directory in debuginfo packages
rpmbuild might create world writeable /usr/src/debug/tmp directory in debugin...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpm (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: packaging-team-maint
Jan Blazek
:
Depends On:
Blocks: 1465896 1466368
  Show dependency treegraph
 
Reported: 2017-04-11 04:27 EDT by Mark Wielaard
Modified: 2018-04-10 11:59 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 11:58:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0877 None None None 2018-04-10 11:59 EDT

  None (edit)
Description Mark Wielaard 2017-04-11 04:27:54 EDT
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@fedoraproject.org>
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 16:26:48 EDT
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 11:58:38 EDT
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

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