From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7 Description of problem: SSIA. Additional problem is that if a user has privilege to mount a loopback device (also an encrypted partition) and accidentally mounts it once more he can't unmount it, umount says it's mounted multiple times, and only root can resolve it. Version-Release number of selected component (if applicable): util-linux-2.12a-24.5 How reproducible: Always Steps to Reproduce: Scenario for root: 1. dd if=/dev/zero of=/tmp/testloop ibs=1024 count=1024; mkdir /tmp/testmnt; mke2fs -F /tmp/testloop 2. mount -o loop /tmp/testloop /tmp/testmnt 3. mount -o loop /tmp/testloop /tmp/testmnt (yeah, twice) Scenario for a common user: 1. = the first step, as above 2. echo /tmp/testloop /tmp/testmnt ext2 loop,user 0 0 >> /etc/fstab 3. (as a common user) mount /tmp/testmnt ; mount /tmp/testmnt 4. (as a the same common user) umount /tmp/testmnt Actual Results: [1] no error, mounted twice (see `mount`) [2] = [1] + the user cannot unmount it Expected Results: [1] error message, mounted only once [2] = [1] (thus mounted once) + unmountable by user Additional info:
Good catch! The check for "alredy mounted" is based on EBUSY (mount(2)), but this is not true for "-o loop" where the mount command creates always new device :-) $ cat /etc/mtab | grep loop /tmp/testloop /tmp/testmnt ext2 rw,noexec,nosuid,nodev,loop=/dev/loop0,user=zakkr 0 0 /tmp/testloop /tmp/testmnt ext2 rw,noexec,nosuid,nodev,loop=/dev/loop1,user=zakkr 0 0 $ cat /proc/mounts | grep loop /dev/loop0 /tmp/testmnt ext2 rw,nosuid,nodev,noexec,nogrpid 0 0 /dev/loop1 /tmp/testmnt ext2 rw,nosuid,nodev,noexec,nogrpid 0 0
Fixed in FC4 and FC5. I'm going to fix it in FC3 with something more important...
Thanks very much. I tried the new version on rawhide and it indeed works as expected.