'unmount' fails for user mounted file system

Bug #295944 reported by Ken Pratt
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: mount

I use an encrypted ext3 file system stored in a file. I mount this file system through the cryptoloop module and a loop device. This approach worked fine in 8.04. On a fresh install of 8.10 amd64 Desktop, I receive the following when I attempt to unmount the user mounted filesystem.

umount: /mnt/secure mount disagrees with the fstab

Here is the line in my fstab file:

/media/BigData/secure.img /mnt/secure auto user,noauto,loop,encryption=twofish 0 0

As a regular user, I am able to execute 'mount /mnt/secure'. I get prompted for a password and the file system is mounted on /mnt/secure as usual.

When I attempt 'umount /mnt/secure', I get the error cited above. If I become root, then I am able to unmount the file system. I should be able to do it as the user that originally mounted the file system.

* I marked the bug as a security vulnerability as it requires 'root' privileges to unmount a user mounted file system.

Revision history for this message
Henning Mersch (ubuntu-hmersch) wrote :

Same here (Kubuntu 8.10, 32bit Desktop, backports enabled...)

No attention to this? Very strange .... nobody encrypting their USB Sticks, which
would (I think) use this princip?

As a workaround I added
/dev/loop0 /mnt/secure auto user,noauto,loop,encryption=twofish 0 0
to the fstab, which enabled user to unmount ... BUT:
... this means I have TO PRAY that /mnt/secure is mounted via loop0 ...

Regards - Henning

Kees Cook (kees)
Changed in util-linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Kevin Smith (ubuntu-qualitycode) wrote :

This is not just for encrypted mounts. I have an hfsplus loopback mount and cannot umount it. This worked fine in 8.04, but fails in 9.04.

Here is my /etc/fstab:

  /home/j2ee-hudson/Miradi/Miradi.dmg /mounts/Miradi/dmgfile hfsplus rw,user,loop,noauto 0 0

Here is my mount command:

  mount -v /mounts/Miradi/dmgfile

Here is what ends up in /etc/mtab:

  /dev/loop0 /mounts/Miradi/dmgfile hfsplus rw,noexec,nosuid,nodev,user=kevins 0 0

And here is my attempt to unmount as non-root:

  > umount -d /mounts/Miradi/dmgfile
  umount: /mounts/Miradi/dmgfile mount disagrees with the fstab

I'm a software developer, and my automated builds are now failing because of this. The workaround mentioned above (adding a /dev/loop0 line to fstab) does work, but also makes me quite nervous.

Revision history for this message
infodroid (infodroid) wrote :

@Kevin. This is an ugly hack. But if you put your second line beginning with "/dev/loop0" into your /etc/fstab, then you will be able to run the unmount for your /mounts dmgfile. Just remember to add noauto so it doesn't mount twice on bootup.

Revision history for this message
Daniel Harvey (daniel.harvey) wrote :

The hack works. Quick note that you can specify the loop device in both lines, which is a little safer than assuming loop0 i.e.

/media/USBDISK/.fs.ext3 /media/USBDISK/fs ext2 defaults,noauto,loop=/dev/loop3,user,exec 0 0
/dev/loop3 /media/USBDISK/fs ext2 defaults,noauto,loop=/dev/loop3,user,exec 0 0

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.