Bug 846848 - mount -o loop allows mounting filesystems that are already mounted
mount -o loop allows mounting filesystems that are already mounted
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: util-linux-ng (Show other bugs)
6.2
x86_64 Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Karel Zak
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-08 17:30 EDT by Eric Parish
Modified: 2012-08-15 11:55 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-15 11:55:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Parish 2012-08-08 17:30:32 EDT
Description of problem:
mount -o loop allows users to mount a filesystem already mounted with no warning. 

This seems dangerous. For example, when I run mount -o loop / it causes / to mount onto itself and immediate filesystem corruption.  

Version-Release number of selected component (if applicable):
Tested on RedHat 5, 6 and Fedora 17.  

How reproducible:
Always

Steps to Reproduce:
1. Mount a block device already mounted with the loop option:
mount -o loop <block device> <mount point>
  
Actual results:
A loopback device is created from the block device and mounted with no errors. 

Expected results:
The command fails with a warning that the filesystem is already mounted. 

Additional info:
Comment 2 Karel Zak 2012-08-15 11:55:35 EDT
The mount(8) command does not play such role in the system -- it's
kernel (filesystem driver) business to define what is allowed. The 
behavior is filesystem specific -- for example ext4 allows to use MMP
(multi-mount-protection, since e2fsprogs 1.42) to avoid this kind of
problems.

Seems like not a bug. Sorry.

Note You need to log in before you can comment on or make changes to this bug.