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 1152291

Summary: sandbox startup script should also ignore /dev/shm
Product: Red Hat Enterprise Linux 6 Reporter: Eric Rich <erich>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.6CC: dwalsh, mgrepl, mmalik, plautrba, pvrabec
Target Milestone: rc   
Target Release: 6.7   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1159336 (view as bug list) Environment:
Last Closed: 2014-10-31 15:13:45 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: 1075802, 1159336    

Description Eric Rich 2014-10-13 19:25:57 UTC
Description of problem:

When using sandbox and OpenShift (v3 [community]) together, thousands (5963 at last count) of /dev/shm namespaced mounts will be created.

If sandbox is set to ignore /dev/shm, everything works as expected.

OpenShift and probably GearD mount /dev/shm in every namespace that they create. Unfortunately, they don't get unmounted afterward (because they're not using the 'sandbox' command) and it turns into a mess.

This needs a whitelist of items to make private and remount such that they do not get duplicated by other processes that attempt to create a new namespace.

By default, /tmp and /var/tmp are ignored by the sandbox and it stands to reason that all default temporary spaces should be ignored similarly.

It's easy enough to hack around by adding the directories to the HOMEDIRS variable in /etc/sysconfig/sandbox but that's not a terrific solution out of the box given such an obvious use case (and that it's misleading since this isn't a home directory).

Version-Release number of selected component (if applicable): 1.2
How reproducible: Very


Steps to Reproduce:
1. Start and Stop a lot of Docker containers with OpenShift Origin v3 (M5)


Additional info:

We're enabling the 'sandbox' features from policycoreutils (service sandbox start).

I would posit that the following change to the init script would probably do "the right thing":

start() {
  echo -n "Starting sandbox"

  [ -f "$LOCKFILE" ] && return 1

  touch $LOCKFILE
  mount --make-rshared / || return $?
  mount --rbind /tmp /tmp || return $?
  mount --rbind /var/tmp /var/tmp || return $?
  mount --make-private /tmp || return $?
  mount --make-private /var/tmp || return $?
  for h in $HOMEDIRS; do
      mount --rbind $h $h || return $?
      mount --make-private $h || return $?
  done
  # Added stuff here
  for t in `mount | grep tmpfs | cut -f3 -d' '`; do
      mount --rbind $t $t || return $?
      mount --make-private $t || return $?
  done
  # End added stuff

  return 0
}