Bug 1538760 - User can not mount ecryptfs folder if it is not the owner
Summary: User can not mount ecryptfs folder if it is not the owner
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: ecryptfs-utils
Version: 28
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-25 18:46 UTC by Paolo
Modified: 2019-05-28 23:43 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-05-28 23:43:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1480793 0 unspecified CLOSED ecryptfs-mount-private fails to mount if passphrase is not on root's keyring 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1481481 0 unspecified CLOSED SELinux is preventing ecryptfs auto-umount of home dir 2021-02-22 00:41:40 UTC

Internal Links: 1480793 1481481

Description Paolo 2018-01-25 18:46:16 UTC
Description of problem:
I created two shared folders /home/.test and /home/test and assigned it to the group "test". 

Added an user to the group "test".

Mounted /home/.test on /home/test using ecryptfs. 
Added the entry in fstab and modified adding "user" and "group" options.

Mounting it as root work flawlessly.
Trying to mount as user does not work.

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

kernel version: $ uname -r
4.14.14-300.fc27.x86_64

ecryptfs-utils version
Nome         : ecryptfs-utils
Versione     : 111
Rilascio     : 7.fc27
Arch         : x86_64
Dim.         : 608 k
Sorgente     : ecryptfs-utils-111-7.fc27.src.rpm
Repo         : @System
Dal repo     : fedora
Sommario     : The eCryptfs mount helper and support libraries
URL          : https://launchpad.net/ecryptfs
Licenza      : GPLv2+
Descrizione  : eCryptfs is a stacked cryptographic filesystem that ships in
             : Linux kernel versions 2.6.19 and above. This package provides the
             : mount helper and supporting libraries to perform key management
             : and mount functions.
             : 
             : Install ecryptfs-utils if you would like to mount eCryptfs.



Steps to Reproduce:

------ AS ROOT

# cd /home
# mkdir .test test
# groupadd test
# chgrp test test/ .test/
# usermod -a -G test paolo
# chmod 2755 test/
# chmod 2775 .test/

# mount.ecryptfs .test/ test/ (follow terminal instructions)

#cat /etc/fstab 
/home/.test /home/test ecryptfs rw,relatime,user,group,noauto,ecryptfs_fnek_sig=274cdd7386890c3e,ecryptfs_sig=274cdd7386890c3e,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_unlink_sigs 0 0

# reboot

# ecryptfs-add-passphrase
Passphrase: 
Inserted auth tok with sig [274cdd7386890c3e] into the user session keyring

# mount -i /home/.test

works as expected

------ AS NORMAL USER (PAOLO)

$ groups paolo 
paolo : paolo wheel idocumenti test

$ ecryptfs-add-passphrase 
Passphrase: 
Inserted auth tok with sig [274cdd7386890c3e] into the user session keyring

$ mount -i /home/.test/
mount: /home/test: mount(2) system call failed: No such file or directory.



Additional info:

Tried with the same configuration on a virtual machine running Debian 9 and it works as expected.

Comment 1 Raphael Groner 2018-04-11 19:22:42 UTC
You could try to mount with ecryptfs-simple instead.

Comment 2 Paolo 2018-04-14 08:00:56 UTC
(In reply to Raphael Groner from comment #1)
> You could try to mount with ecryptfs-simple instead.

I don't know what ecryptfs-simple actually does. In the meantime i tried the same step on Arch and openSuse Tumbleweed and both of them worked like a charm.

Comment 3 Raphael Groner 2018-04-14 17:12:11 UTC
Might be an issue with wrong ACL then, propably SELinux related.
Please check the logs.

Comment 4 Paolo 2018-06-06 16:41:10 UTC
Hi Raphael, sorry for replying after so long. I've been a bit busy. I installed Fedora Workstation 28 in gnome-boxes. 
The same bug also affected this version. I'm not that expert to provide you the file you need. Which log do I read?

Comment 6 Raphael Groner 2018-06-23 13:03:25 UTC
Issues with SELinux seem to be quite common, bug #1481481.

Comment 7 Paolo 2018-07-01 13:20:07 UTC
Done as you said in comment #5
I can't find seaudit in Fedora 28. I looked /var/log/audit/audit.log.

tail -n 3 /var/log/audit/audit.log 
type=USER_ACCT msg=audit(1530450665.434:280): pid=12717 uid=1000 auid=1000 ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:accounting grantors=pam_unix,pam_localuser acct="root" exe="/usr/bin/su" hostname=localhost.localdomain addr=? terminal=pts/0 res=success'
type=CRED_ACQ msg=audit(1530450665.435:281): pid=12717 uid=1000 auid=1000 ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_unix,pam_ecryptfs acct="root" exe="/usr/bin/su" hostname=localhost.localdomain addr=? terminal=pts/0 res=success'
type=USER_START msg=audit(1530450665.443:282): pid=12717 uid=1000 auid=1000 ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_open grantors=pam_keyinit,pam_keyinit,pam_limits,pam_ecryptfs,pam_systemd,pam_unix,pam_umask acct="root" exe="/usr/bin/su" hostname=localhost.localdomain addr=? terminal=pts/0 res=success'

I can not understand the meaning of these lines.

Comment 8 Paolo 2018-07-02 14:15:19 UTC
UPDATE: I completely disabled selinux and tried to mount /home/test with same result. I don't know if it is a useful information.

Comment 9 Paolo 2018-07-03 17:24:15 UTC
Also enabling again selinux and trying the mounting procedure returns the same error.

Checked /var/log/audit/audit.log with:

# tail /var/log/audit/audit.log  | grep denied

but no result. It seems to me that selinux is not preventing any access to the shared folder. Is this a selinux related problem?
I'm currently using Arch due to this bug. I can try to enable selinux ad looking what happens...

Comment 10 Raphael Groner 2018-07-19 21:31:55 UTC
TBH it's doubtful we can fix in Fedora as downstream what you expect. The usual howotos suggest to assign the specific user to it's folder, no idea if it should work for groups in any case. Maybe try to ask upstream for a RFE.

Comment 11 Ben Cotton 2019-05-02 19:50:01 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Ben Cotton 2019-05-28 23:43:54 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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