lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200804290008.45665.elendil@planet.nl>
Date:	Tue, 29 Apr 2008 00:08:45 +0200
From:	Frans Pop <elendil@...net.nl>
To:	linux-ide@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org
Subject: Inconsistent behavior of mount for CDs

Hi all,

For the Debian Installer we've been struggling with the following issue.

The CD-based installation is running (i386 using 2.6.24) mostly in memory.
The CD is mounted on /cdrom as the installer needs access to the CD.

The system being installed is mounted on /target and it too needs to install 
packages from the CD. Up till recently we've been using a bind mount for 
this, but there are some reasons we'd like to change that to mounting the 
CD itself twice.

For most installs (both in Virtualbox and on real hardware) mounting the 
same CD simultaneously on /cdrom and in the /target chroot on /media/cdrom0 
works fine, but for some installs the second mount (in the chroot) fails 
with an -EBUSY.
The issue is 100% reproducible for installs on the same system, so the 
difference seems either hardware or driver related as the installs 
themselves are basically identical. Nothing is actually accessing the CD at 
the time the second mount is being done.

AFAIK having the same CD mounted twice should normally not be a problem 
(just like a hard disk can be mounted twice). The only limitation I'd 
expect is that a CD that is still mounted at least once cannot be ejected.

Attached an strace for both a successful and an unsuccessful mount (done 
through a 'apt-cdrom add' command executed in /target chroot).
The relevant difference seems to be simply:
-25791 mount("/dev/hdc", "/media/cdrom0", "iso9660", MS_MGC_VAL|MS_NOSUID|
MS_NODEV|MS_NOEXEC, NULL) = -1 EROFS (Read-only file system)
+26735 mount("/dev/hda", "/media/cdrom0", "iso9660", MS_MGC_VAL|MS_NOSUID|
MS_NODEV|MS_NOEXEC, NULL) = -1 EBUSY (Device or resource busy)

The hardware for the 2 straces is quite different (the failing one is real 
hardware, the other is Virtualbox), but by chance they use the same IDE 
driver for the CD: piix. See also attached hw-summary files.

Any ideas what could be causing this difference in behavior?
What is the intended behavior: should one be able to mount a CD twice or 
not?

Cheers,
FJP


Download attachment "apt-cdrom_bad.strace.gz" of type "application/x-gzip" (3309 bytes)

Download attachment "hw-summary_good.txt.gz" of type "application/x-gzip" (1016 bytes)

Download attachment "apt-cdrom_good.strace.gz" of type "application/x-gzip" (41593 bytes)

Download attachment "hw-summary_bad.txt.gz" of type "application/x-gzip" (1672 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ