Bug 706280 - deja-dup fails with value 30 if called by confined user
Summary: deja-dup fails with value 30 if called by confined user
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: deja-dup
Version: 14
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Rahul Sundaram
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-19 22:14 UTC by Joachim Katzer
Modified: 2012-08-16 21:31 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-16 21:31:54 UTC
Type: ---


Attachments (Terms of Use)
AVCs during login as user_u (54.49 KB, text/plain)
2011-05-23 20:10 UTC, Joachim Katzer
no flags Details
syslog messages during login at the same time (29.12 KB, text/plain)
2011-05-23 20:16 UTC, Joachim Katzer
no flags Details

Description Joachim Katzer 2011-05-19 22:14:27 UTC
Description of problem:
A confined user (e.g. user_u or staff_u) cannot use deja-dup because it fails with exit code 30 and Python exception:
Traceback (most recent call last):
...
   File "/usr/lib64/python2.7/site-packages/duplicity/path.py", line 491, in setdata
    self.stat = os.lstat(self.name)
OSError: [Errno 107] Transport endpoint is not connected: '/home/joachim/.gvfs'


Version-Release number of selected component (if applicable):
deja-dup-16.1.1-1.fc14.x86_64
gvfs-1.6.6-1.fc14.x86_64
selinux-policy-3.9.7-40.fc14.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create a new user (e.g. test), call "sudo semanage login -a -s user_u test"
2. Login to user "test" via GDM choosing GNOME desktop
3. Call deja-dup, configure and start "backup"
  
Actual results:
Failed with Python exception because ~/.gvfs is not accessible.
$ ls -ld ~/.gvfs
ls: cannot access .gvfs: Transport endpoint is not connected

Expected results:
Either ~/.gvfs should be accessible by confined user, or deja-dup should not rely on gvfs to work.

Additional info:
There's no obvious AVC reporting access problem with gvfs.
gvfs and deja-dup works for unconfined user.

Comment 1 Rahul Sundaram 2011-05-20 06:04:56 UTC
Dan Walsh, 

CC'ing you here.  Do take a look and let me know what the appropriate way to handle this is.

Comment 2 Daniel Walsh 2011-05-23 15:39:23 UTC
Could you execute 

# semodule -DB 

Then try this again and see if there are AVC's reported?

Comment 3 Joachim Katzer 2011-05-23 20:10:53 UTC
Created attachment 500497 [details]
AVCs during login as user_u

Test user name is "test_user_u", user id is 504

Comment 4 Joachim Katzer 2011-05-23 20:16:57 UTC
Created attachment 500499 [details]
syslog messages during login at the same time

Comment 5 Daniel Walsh 2011-05-23 20:20:14 UTC
# semodule -B 

Will turn the dontaudit rules back on.

Sadly this did not show the error.

Comment 6 Daniel Walsh 2011-05-23 20:35:35 UTC
Are you sure this is an SELinux issue.  I see nothing in the logs concerning this.

If you put the machine in permissive mode, does it work?

Comment 7 Joachim Katzer 2011-05-23 22:35:27 UTC
(In reply to comment #6)
> Are you sure this is an SELinux issue.  
Yes
> 
> If you put the machine in permissive mode, does it work?
Yes

Before I posted this bug report I had already tried to turn dontaudit rules off and to look into the audit files without any idea what could go wrong.

May be ~/.gvfs is a special case: "gvfs is not a filesystem it is a memory resident tree representing configuration controls for gnome." It is also not accessible for root. (according to http://forums.fedoraforum.org/showpost.php?p=1439804&postcount=5). 

Now I think I have found the responsible AVC:
type=AVC msg=audit(1305837227.901:97): avc:  denied  { read write } for  pid=2043 comm="fusermount" path="socket:[18540]" dev=sockfs ino=18540 scontext=user_u:user_r:mount_t:s0 tcontext=user_u:user_r:user_t:s0 tclass=unix_stream_socket

From this AVC audit2allow has generated following gvfsmount.te file (rule for staff_t manually added by me): 

module gvfsmount 1.0;

require {
	type mount_t;
	type user_t;
	type staff_t;
	class unix_stream_socket { read write };
}

#============= mount_t ==============
#!!!! This avc has a dontaudit rule in the current policy

allow mount_t user_t:unix_stream_socket { read write };
allow mount_t staff_t:unix_stream_socket { read write };


After a "make -f /usr/share/selinux/devel/Makefile && semodule -i gvfsmount.pp" ~/.gvfs is now created properly and deja-dup is working for confined users user_t and staff_t! I hope the rules are not too general (from a security point of view).

Comment 8 Daniel Walsh 2011-05-24 16:32:27 UTC
I have no problem with that.

Miroslav lets add

	allow mount_t $1:unix_stream_socket { read write };


To mount_domtrans_fusermount in RHEL6 and F14, F15

Comment 9 Fedora End Of Life 2012-08-16 21:31:56 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

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

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached 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 to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


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