public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:2.X commit in: modules/
Date: Wed,  1 Jan 2014 22:03:53 +0000 (UTC)	[thread overview]
Message-ID: <1388613791.e1dffd789f91235190b12f78edb5d1e262affb27.dol-sen@gentoo> (raw)

commit:     e1dffd789f91235190b12f78edb5d1e262affb27
Author:     Douglas Freed <dwfreed <AT> mtu <DOT> edu>
AuthorDate: Wed Jan  1 21:18:22 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Jan  1 22:03:11 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=e1dffd78

Mount /dev/shm in the chroot with the right options

Bind mounting /dev/shm into the chroot isn't a good idea, as there may
be collisions and result in weird side effects.  Instead, we can just
mount a new tmpfs there, with the right options to ensure security.

---
 modules/generic_stage_target.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 9edafe9..37d1fa1 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -179,13 +179,13 @@ class generic_stage_target(generic_target):
 			self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
 				"/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs",
-				"/dev/shm": "/dev/shm"}
+				"/dev/shm": "shmfs"}
 		else:
 			self.mounts=["/proc", "/dev", "/usr/portage/distfiles",
 				"/var/tmp/portage"]
 			self.mountmap={"/proc":"/proc","/dev":"/dev","/dev/pts":"/dev/pts",\
 				"/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs",
-				"/dev/shm": "/dev/shm"}
+				"/dev/shm": "shmfs"}
 		if os.uname()[0] == "Linux":
 			self.mounts.append("/dev/pts")
 			self.mounts.append("/dev/shm")
@@ -904,7 +904,7 @@ class generic_stage_target(generic_target):
 				os.makedirs(self.settings["chroot_path"]+x,0755)
 
 			if not os.path.exists(self.mountmap[x]):
-				if not self.mountmap[x] == "tmpfs":
+				if self.mountmap[x] != "tmpfs" and self.mountmap[x] != "shmfs":
 					os.makedirs(self.mountmap[x],0755)
 
 			src=self.mountmap[x]
@@ -923,6 +923,9 @@ class generic_stage_target(generic_target):
 						retval=os.system("mount -t tmpfs -o size="+\
 							self.settings["var_tmpfs_portage"]+"G "+src+" "+\
 							self.settings["chroot_path"]+x)
+				elif src == "shmfs":
+					retval=os.system("mount -t tmpfs -o noexec,nosuid,nodev shm "+\
+						self.settings["chroot_path"]+x)
 				else:
 					retval=os.system("mount --bind "+src+" "+\
 						self.settings["chroot_path"]+x)


             reply	other threads:[~2014-01-01 22:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-01 22:03 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-01-19  3:19 [gentoo-commits] proj/catalyst:2.X commit in: modules/ Anthony G. Basile
2014-12-19  1:23 Jorge Manuel B. S. Vicetto
2014-12-06 17:37 Jorge Manuel B. S. Vicetto
2014-12-06 16:56 Jorge Manuel B. S. Vicetto
2014-05-16 19:15 Brian Dolbec
2014-04-05  7:36 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-03-24 16:08 Brian Dolbec
2014-01-01 21:40 Brian Dolbec
2014-01-01 14:47 Brian Dolbec
2013-12-31 23:27 Brian Dolbec
2013-12-31 20:15 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1388613791.e1dffd789f91235190b12f78edb5d1e262affb27.dol-sen@gentoo \
    --to=brian.dolbec@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox