Bug 432062 - Sharing compiler cache between the mock users seems to be a bad idea
Sharing compiler cache between the mock users seems to be a bad idea
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
19
All Linux
high Severity high
: ---
: ---
Assigned To: Clark Williams
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-08 12:28 EST by Jay Turner
Modified: 2015-01-16 05:28 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-10-23 09:19:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Do not use shared ccache caches by default (3.95 KB, patch)
2008-08-28 17:47 EDT, Ville Skyttä
no flags Details | Diff

  None (edit)
Description Lubomir Kundrak 2008-02-08 12:28:54 EST
Description of problem:

1.) CCACHE_UMASK being 002 causes executables to be created with mode 0775. This
at the very least makes some rpms (python modules that use setup.py) contain
files with different mode than expected (bug #427027 comment #2) and makes
rpmlint complain.

2.) I suspect it might be possible for one mock user to 'poison' the cache with
incorrectly generated code. This would be a security issue if mock users were
not expected to trust themselves, but given the fact they also share to build
root cache this is probably not an issue.

However; 1.) definitely outweighs benefits of sharing the cache -- I tend to
think that in vast majority of cases the number of mock users is not big enough
to significantly benefit from sharing the compiler cache.

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

mock-0.8.19-1.fc8
Comment 1 Bug Zapper 2008-05-14 01:05:31 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 2 Lubomir Rintel 2008-05-19 17:42:52 EDT
I am wondering whether there are plans to do anything about this?
Comment 3 Michael E Brown 2008-05-19 18:24:11 EDT
So, a couple of observations:

I dont know of anybody using mock in a situation where they dont trust their
users. We have explicitly disclaimed any guarantees of security for this
scenario, as mock has not been audited for use by untrusted users, and there are
currently *trivial* methods that users with access to mock can use to elevate
privs ("mock shell" can trivially be used to elevate privs.)

That being said, I dont think it is unreasonable to add a patch to set the
CCACHE_UMASK to make it less likely for users to be able to overwrite each
other's cache files. If you attach a well-coded patch to set this, then I dont
see any blocking issue to accepting it.
Comment 5 Ville Skyttä 2008-08-28 17:47:54 EDT
Created attachment 315303 [details]
Do not use shared ccache caches by default

The mode 0775 alone can be a security issue for non (root,root) owned files.  I think it's very reasonable to expect that the sequence:

   %build
   umask 022
   gcc -o foo [...]

   %install
   umask 022
   cp -p foo $RPM_BUILD_ROOT%{_bindir}

   %files
   %defattr(-,root,somegroup,-)
   %{_bindir}/foo

...would result in /usr/bin/foo, owned by (root,somegroup), mode 0755 being in the resulting binary package.  But due to the issue at hand, /usr/bin/foo would be unexpectedly writable by the "somegroup" group.

I started patching, results attached.  It works otherwise except that I made the mistake of using chrootuser (== mockbuild) when I would have wanted the real username of who is running mock.  Looks like the real username is not currently available in the object model so some more work would be needed.  Also if the cache is not shared by default, its default size could be lowered to something less than 4G.
Comment 6 Jesse Keating 2009-02-05 17:55:48 EST
Michael, do you want to take the above patch?
Comment 7 Bug Zapper 2009-06-09 19:31:25 EDT
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 8 Bug Zapper 2009-11-16 03:01:19 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 9 Bug Zapper 2010-11-04 08:02:31 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 10 Jay Turner 2011-02-15 10:41:02 EST
Clearing the NeedInfo as I have no clue why info is being requested from me.
Comment 11 Clark Williams 2011-03-11 12:08:53 EST
Pulled in Ville's patch for testing, looking at adding to mock for the 1.1.10 release.
Comment 12 Clark Williams 2011-03-11 12:29:52 EST
Hmmph. I see what Ville was talking about in that the only username we have available in the chroot is 'mockuser'. Not sure if this is worth the effort of adding real usernames to the chroot password file. 

Anyone have an opinion here? If I don't hear anything in a few days I'll probably close this as NOTABUG.
Comment 13 Fedora Admin XMLRPC Client 2011-03-11 13:09:01 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 14 Fedora End Of Life 2013-04-03 15:50:24 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
Comment 15 Miroslav Suchý 2014-10-23 09:19:29 EDT
Closing per #12. If somebody have better idea or even patch, then feel free to reopen.
Comment 16 Miroslav Suchý 2015-01-16 05:28:13 EST
This was actually fixed in bug 1168116.

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