Bug 846848

Summary: mount -o loop allows mounting filesystems that are already mounted
Product: Red Hat Enterprise Linux 6 Reporter: Eric Parish <eric.parish>
Component: util-linux-ngAssignee: Karel Zak <kzak>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-15 15:55:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eric Parish 2012-08-08 21:30:32 UTC
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 15:55:35 UTC
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.