Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 554108

Summary: sys-apps/portage-2.2.20: FEATURES=cgroup is vulnerable interference between parallel builds of the same ${CATEGORY}:${PF}
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - Ebuild SupportAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: 2.2   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=851015
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 549914    

Description Zac Medico gentoo-dev 2015-07-07 00:42:09 UTC
The vulnerable code in AbstractEbuildProcess is as follows:

    cgroup_path = os.path.join(cgroup_portage,
            '%s:%s' % (self.settings["CATEGORY"],
                self.settings["PF"]))

Instead, we should use tempfile.mkdtemp or something similar.
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2015-07-07 01:02:05 UTC
sounds good to me :)
Comment 2 Zac Medico gentoo-dev 2015-07-07 05:09:08 UTC
The number of temp dirs that we will create is unlimited, so we need to ensure that they are promptly destroyed. We can unshare the mount namespace and make /sys/fs/cgroup/portage a private mount which will automatically disappear when portage exits.
Comment 3 Zac Medico gentoo-dev 2015-07-07 07:31:58 UTC
There's a patch in the following branch:

https://github.com/zmedico/portage/tree/bug_554108

I've posted it for review here:

https://archives.gentoo.org/gentoo-portage-dev/message/86f2105d445897c3690df7856371093f
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2015-09-22 01:22:39 UTC
Released in portage-2.2.21