[buildd-tools-devel] Bug#793081: schroot: tmpfs mounted in a chroot's /dev/shm is not properly unmounted

Raphaël Hertzog hertzog at debian.org
Tue Jul 21 08:16:41 UTC 2015


Package: schroot
Version: 1.6.10-1.1
Severity: normal
User: devel at kali.org
Usertags: origin-kali

Consider the log below and you'll see that /dev/shm is mounted
in the chroot setup but it's never umounted when the chroot is
ended. That's because schroot-listmounts is not listing
it. The chroot is using "aufs" union-type.

This is on a jessie system.

root at aphrodite:~# mount|grep -c /dev/shm
1
root at aphrodite:~# schroot -v -b -c moto-amd64-sbuild
I: Executing ‘00check setup-start ok’
I: 00check: STAGE=setup-start
I: 00check: STATUS=ok
I: 00check: AUTH_GID=0
I: 00check: AUTH_HOME=/root
I: 00check: AUTH_RGID=0
I: 00check: AUTH_RGROUP=root
I: 00check: AUTH_RUID=0
I: 00check: AUTH_RUSER=root
I: 00check: AUTH_SHELL=/bin/bash
I: 00check: AUTH_UID=0
I: 00check: AUTH_USER=root
I: 00check: CHROOT_ALIAS=moto-amd64-sbuild
I: 00check: CHROOT_DESCRIPTION=Kali moto/amd64 (session chroot)
I: 00check: CHROOT_DIRECTORY=/srv/chroots/moto-amd64-sbuild
I: 00check: CHROOT_MOUNT_LOCATION=/var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 00check: CHROOT_NAME=moto-amd64-sbuild
I: 00check: CHROOT_PATH=/var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 00check: CHROOT_PROFILE=sbuild
I: 00check: CHROOT_PROFILE_DIR=/etc/schroot/sbuild
I: 00check: CHROOT_SESSION_CLONE=false
I: 00check: CHROOT_SESSION_CREATE=false
I: 00check: CHROOT_SESSION_PURGE=true
I: 00check: CHROOT_TYPE=directory
I: 00check: CHROOT_UNION_OVERLAY_DIRECTORY=/var/lib/schroot/union/overlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 00check: CHROOT_UNION_TYPE=aufs
I: 00check: CHROOT_UNION_UNDERLAY_DIRECTORY=/var/lib/schroot/union/underlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 00check: DATA_DIR=/usr/share/schroot
I: 00check: LIBEXEC_DIR=/usr/lib/x86_64-linux-gnu/schroot
I: 00check: MOUNT_DIR=/var/lib/schroot/mount
I: 00check: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
I: 00check: PID=3492
I: 00check: PLATFORM=linux
I: 00check: PWD=/
I: 00check: SESSION_ID=moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 00check: SETUP_CONFIG=/etc/schroot/sbuild/config
I: 00check: SETUP_COPYFILES=/etc/schroot/sbuild/copyfiles
I: 00check: SETUP_DATA_DIR=/usr/share/schroot/setup
I: 00check: SETUP_FSTAB=/etc/schroot/sbuild/fstab
I: 00check: SETUP_NSSDATABASES=/etc/schroot/sbuild/nssdatabases
I: 00check: SHLVL=1
I: 00check: SYSCONF_DIR=/etc/schroot
I: 00check: VERBOSE=verbose
I: 00check: _=/usr/bin/env
I: Executing ‘05btrfs setup-start ok’
I: Executing ‘05file setup-start ok’
I: Executing ‘05lvm setup-start ok’
I: Executing ‘05union setup-start ok’
I: Executing ‘10mount setup-start ok’
I: 10mount: Mounting /srv/chroots/moto-amd64-sbuild on /var/lib/schroot/union/underlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 10mount: -v --bind  /srv/chroots/moto-amd64-sbuild /var/lib/schroot/union/underlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 10mount: mount: /srv/chroots/moto-amd64-sbuild bound on /var/lib/schroot/union/underlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44.
I: 10mount: Using 'aufs' for filesystem union
I: 10mount: mount: /proc bound on /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/proc.
I: 10mount: mount: /sys bound on /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/sys.
I: 10mount: mount: /dev/pts bound on /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/dev/pts.
I: 10mount: mount: tmpfs mounted on /dev/shm.
I: 10mount: mount: /var/lib/sbuild/build bound on /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/build.
I: Executing ‘15binfmt setup-start ok’
I: 15binfmt: Missing update-binfmts; not enabling binfmt support
I: Executing ‘15killprocs setup-start ok’
I: Executing ‘20copyfiles setup-start ok’
I: Executing ‘20nssdatabases setup-start ok’
I: 20nssdatabases: Copying passwd database to /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/etc/passwd
I: 20nssdatabases: Copying shadow database to /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/etc/shadow
I: 20nssdatabases: Copying group database to /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/etc/group
I: 20nssdatabases: Copying gshadow database to /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/etc/gshadow
I: Executing ‘50chrootname setup-start ok’
I: 50chrootname: Setting chroot name to moto-amd64-sbuild
I: Executing ‘70services setup-start ok’
I: 70services: Starting services
I: Executing ‘99check setup-start ok’
moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
root at aphrodite:~# /usr/lib/x86_64-linux-gnu/schroot/schroot-listmounts -m /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
/var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/build
/var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/dev/pts
/var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/sys
/var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/proc
/var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
root at aphrodite:~# schroot -v -e -c moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: Executing ‘99check setup-stop ok’
I: 99check: STAGE=setup-stop
I: 99check: STATUS=ok
I: 99check: AUTH_GID=0
I: 99check: AUTH_HOME=/root
I: 99check: AUTH_RGID=0
I: 99check: AUTH_RGROUP=root
I: 99check: AUTH_RUID=0
I: 99check: AUTH_RUSER=root
I: 99check: AUTH_SHELL=/bin/bash
I: 99check: AUTH_UID=0
I: 99check: AUTH_USER=root
I: 99check: CHROOT_ALIAS=moto-amd64-sbuild
I: 99check: CHROOT_DESCRIPTION=Kali moto/amd64 (session chroot)
I: 99check: CHROOT_DIRECTORY=/srv/chroots/moto-amd64-sbuild
I: 99check: CHROOT_MOUNT_LOCATION=/var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 99check: CHROOT_NAME=moto-amd64-sbuild
I: 99check: CHROOT_PATH=/var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 99check: CHROOT_PROFILE=sbuild
I: 99check: CHROOT_PROFILE_DIR=/etc/schroot/sbuild
I: 99check: CHROOT_SESSION_CLONE=false
I: 99check: CHROOT_SESSION_CREATE=false
I: 99check: CHROOT_SESSION_PURGE=true
I: 99check: CHROOT_TYPE=directory
I: 99check: CHROOT_UNION_OVERLAY_DIRECTORY=/var/lib/schroot/union/overlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 99check: CHROOT_UNION_TYPE=aufs
I: 99check: CHROOT_UNION_UNDERLAY_DIRECTORY=/var/lib/schroot/union/underlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 99check: DATA_DIR=/usr/share/schroot
I: 99check: LIBEXEC_DIR=/usr/lib/x86_64-linux-gnu/schroot
I: 99check: MOUNT_DIR=/var/lib/schroot/mount
I: 99check: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
I: 99check: PID=4108
I: 99check: PLATFORM=linux
I: 99check: PWD=/
I: 99check: SESSION_ID=moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 99check: SETUP_CONFIG=/etc/schroot/sbuild/config
I: 99check: SETUP_COPYFILES=/etc/schroot/sbuild/copyfiles
I: 99check: SETUP_DATA_DIR=/usr/share/schroot/setup
I: 99check: SETUP_FSTAB=/etc/schroot/sbuild/fstab
I: 99check: SETUP_NSSDATABASES=/etc/schroot/sbuild/nssdatabases
I: 99check: SHLVL=1
I: 99check: SYSCONF_DIR=/etc/schroot
I: 99check: VERBOSE=verbose
I: 99check: _=/usr/bin/env
I: Executing ‘70services setup-stop ok’
I: 70services: Stopping services
I: Executing ‘50chrootname setup-stop ok’
I: Executing ‘20nssdatabases setup-stop ok’
I: Executing ‘20copyfiles setup-stop ok’
I: Executing ‘15killprocs setup-stop ok’
I: 15killprocs: Killing processes run inside /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: Executing ‘15binfmt setup-stop ok’
I: 15binfmt: Missing update-binfmts; not enabling binfmt support
I: Executing ‘10mount setup-stop ok’
I: 10mount: Unmounting /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/build
I: 10mount: Unmounting /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/dev/pts
I: 10mount: Unmounting /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/sys
I: 10mount: Unmounting /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44/proc
I: 10mount: Unmounting /var/lib/schroot/mount/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 10mount: Unmounting /var/lib/schroot/union/underlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: Executing ‘05union setup-stop ok’
I: 05union: Purging /var/lib/schroot/union/overlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: 05union: Removing /var/lib/schroot/union/underlay/moto-amd64-sbuild-dfe01c3b-0ec3-4b9e-a82d-61fab7394d44
I: Executing ‘05lvm setup-stop ok’
I: Executing ‘05file setup-stop ok’
I: Executing ‘05btrfs setup-stop ok’
I: Executing ‘00check setup-stop ok’
root at aphrodite:~# mount|grep -c /dev/shm
2

-- System Information:
Debian Release: 8.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages schroot depends on:
ii  libboost-filesystem1.55.0       1.55.0+dfsg-3
ii  libboost-iostreams1.55.0        1.55.0+dfsg-3
ii  libboost-program-options1.55.0  1.55.0+dfsg-3
ii  libboost-regex1.55.0            1.55.0+dfsg-3
ii  libboost-system1.55.0           1.55.0+dfsg-3
ii  libc6                           2.19-18
ii  libgcc1                         1:4.9.2-10
ii  libpam0g                        1.1.8-3.1
ii  libstdc++6                      4.9.2-10
ii  libuuid1                        2.25.2-6
ii  schroot-common                  1.6.10-1

schroot recommends no packages.

Versions of packages schroot suggests:
pn  aufs-modules | unionfs-modules  <none>
ii  btrfs-tools                     3.17-1.1
ii  debootstrap                     1.0.67
ii  lvm2                            2.02.111-2.2
pn  qemu-user-static                <none>



More information about the Buildd-tools-devel mailing list