Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1510976 - [regression] ordinary user is unable to unmount fs mounted with "user" option
Summary: [regression] ordinary user is unable to unmount fs mounted with "user" option
Status: CLOSED DUPLICATE of bug 1499760
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: util-linux
Version: 7.4
Hardware: All
OS: Linux
Target Milestone: rc
: 7.5
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
Depends On:
TreeView+ depends on / blocked
Reported: 2017-11-08 13:40 UTC by Boyang Xue
Modified: 2017-11-08 15:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-11-08 14:31:09 UTC
Target Upstream Version:

Attachments (Terms of Use)
Failed unmount with EPERM (deleted)
2017-11-08 13:40 UTC, Boyang Xue
no flags Details

Description Boyang Xue 2017-11-08 13:40:34 UTC
Created attachment 1349457 [details]
Failed unmount with EPERM

Description of problem:
An ordinary user is unable to unmount fs mounted with "user" option:

[root@vm mount]# id test
uid=1000(test) gid=1000(test) groups=1000(test),6(disk),10(wheel)
[root@vm mount]# tail -n1 /etc/fstab
/dev/vdb1 /media ext4 user 0 0
[root@vm mount]# su - test -c "mount /dev/vdb1"
[root@vm mount]# strace -o umount.nofork.strace -u test umount /dev/vdb1
umount: /media: umount failed: Operation not permitted
[root@vm mount]# rpm -q util-linux

strace log is attached. Here umount operation should return without error. It's suspected that this is a regression introduced by the fix of BZ 1499760.

Copied from
The 'user' option is described in mount(8) as
"user   Allow an ordinary user to mount the filesystem.  The name of the mounting user is written to mtab so that he can unmount the filesystem again."

I think the problem is that previously we use open(2) to check if a file was writable, and we passed O_CREAT to open(2) too, so file would be created if it was not there. But eaccess(3) doesn't create new file, so /run/mount/utab file won't be created now, and information about the 'user' mount is lost.

Since BZ 1499760 has been cloned to 7.4.z as BZ 1506533. Please consider clone this BZ to 7.4.z as well if necessary.

This bug has been found by running test "user" sub-test of "/kernel/filesystems/general/functional/mount" at side of kernel fs-qe.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. echo "/dev/vdb1 /media ext4 user 0 0" >> /etc/fstab
2. su - test -c "mount /dev/vdb1"
3. su - test -c "umount /dev/vdb1"

Actual results:
umount returns without error

Expected results:
umount fails with "Operation not permitted"

Additional info:

Comment 3 Karel Zak 2017-11-08 14:31:09 UTC

*** This bug has been marked as a duplicate of bug 1499760 ***

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