Debian Bug report logs - #762304
debootstrap doesn't unmount /proc and /sys if caught Ctrl-C

version graph

Package: debootstrap; Maintainer for debootstrap is Debian Install System Team <[email protected]>; Source for debootstrap is src:debootstrap (PTS, buildd, popcon).

Reported by: Askar Safin <[email protected]>

Date: Sat, 20 Sep 2014 21:54:02 UTC

Severity: important

Found in version debootstrap/1.0.48+deb7u1

Full log


đź”— View this message in rfc822 format

X-Loop: [email protected]
Subject: Bug#762304: debootstrap doesn't unmount /proc and /sys if caught Ctrl-C
Reply-To: Cyril Brulebois <[email protected]>, [email protected]
Resent-From: Cyril Brulebois <[email protected]>
Resent-To: [email protected]
Resent-CC: Debian Install System Team <[email protected]>
X-Loop: [email protected]
Resent-Date: Fri, 15 May 2015 03:45:02 +0000
Resent-Message-ID: <[email protected]>
Resent-Sender: [email protected]
X-Debian-PR-Message: followup 762304
X-Debian-PR-Package: debootstrap
X-Debian-PR-Keywords: 
X-Debian-PR-Source: debootstrap
Received: via spool by [email protected] id=B762304.143166123924365
          (code B ref 762304); Fri, 15 May 2015 03:45:02 +0000
Received: (at 762304) by bugs.debian.org; 15 May 2015 03:40:39 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.0-bugs.debian.org_2005_01_02
	(2014-02-07) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-14.0 required=4.0 tests=BAYES_00,FROMDEVELOPER,
	HAS_BUG_NUMBER,PGPSIGNATURE autolearn=ham autolearn_force=no
	version=3.4.0-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 12; hammy, 150; neutral, 72; spammy,
	0. spammytokens: hammytokens:0.000-+--H*u:2014-03-12,
	0.000-+--H*UA:2014-03-12, 0.000-+--H*u:1.5.23, 0.000-+--H*UA:1.5.23,
	0.000-+--H*F:U*kibi
Received: from glenfiddich.mraw.org ([62.210.215.98])
	by buxtehude.debian.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128)
	(Exim 4.80)
	(envelope-from <[email protected]>)
	id 1Yt6UJ-0006Ko-Cy
	for [email protected]; Fri, 15 May 2015 03:40:39 +0000
Received: from localhost ([::1] helo=arya.home.mraw.org)
	by glenfiddich.mraw.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.84)
	(envelope-from <[email protected]>)
	id 1Yt6UH-0000Cp-Js; Fri, 15 May 2015 05:40:37 +0200
Received: from [127.0.0.1] (helo=mraw.org)
	by arya.home.mraw.org with esmtp (Exim 4.84)
	(envelope-from <[email protected]>)
	id 1Yt6UI-0004lX-NM; Fri, 15 May 2015 05:40:38 +0200
Date: Fri, 15 May 2015 05:40:38 +0200
From: Cyril Brulebois <[email protected]>
To: Askar Safin <[email protected]>, [email protected]
Message-ID: <[email protected]>
References: <[email protected]>
 <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="fOHHtNG4YXGJ0yqR"
Content-Disposition: inline
In-Reply-To: <[email protected]>
Organization: Debian
User-Agent: Mutt/1.5.23 (2014-03-12)
[Message part 1 (text/plain, inline)]
Cyril Brulebois <[email protected]> (2014-09-21):
> Well, debootstrap mostly performs the initial bootstraping, so I don't
> think it would be introducing things like bind mounts which would then
> endanger the root filesystem.
> 
> While it probably isn't too difficult to catch signals and do some
> clean-up like unmounting filesystems, I don't think failing to do so
> is a serious bug (important at most), and I'm lowering the severity
> accordingly.

For the record, mounting is done through: umount_on_exit() which records
the specified filesystems to be unmounted in the UMOUNT_DIRS variable,
and adds the umount_exit_function() function to the list of things to
perform on exit, though an on_exit() call.

The following traps are put into place:

    trap "exit_function" 0
    trap "exit 129" 1
    trap "error 130 INTERRUPTED \"Interrupt caught ... exiting\"" 2
    trap "exit 131" 3

Then, exit_function() walks through the actions stored as EXIT_THING_*
by on_exit(), among which is the umount_exit_function() mentioned
earlier.

I'm not sure it would be reasonable to perform all EXIT_THING_* actions
in the interrupted case. I suspect a possible way to implement this
change would be to have an interrupt_function which would iterate over
items stored in UMOUNT_DIRS. If that's possible, that would still be a
bit unsatisfactory to have a direct call from there instead of a call
registered as done in the exit case, but that would avoid the need for
reimplementing the EXIT_THING_* handling…

Mraw,
KiBi.
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 17:30:02 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.