RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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
Keywords:
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
high
high
Target Milestone: rc
: 7.5
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
Last Closed: 2017-11-08 14:31:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Failed unmount with EPERM (14.14 KB, text/plain)
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:

log
---
[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
util-linux-2.23.2-46.el7.x86_64
---

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 https://bugzilla.redhat.com/show_bug.cgi?id=1499760#c14
---
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):
util-linux-2.23.2-46.el7.x86_64

How reproducible:
Always

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:
N/A

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.