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 984323 - sandbox changes everything to sandbox_file_t and restorecon can't recover
Summary: sandbox changes everything to sandbox_file_t and restorecon can't recover
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-14 22:41 UTC by Andy Lutomirski
Modified: 2015-01-14 13:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-14 13:13:05 UTC


Attachments (Terms of Use)

Description Andy Lutomirski 2013-07-14 22:41:22 UTC
Somehow my home directory and its contents got relabed sandbox_file_t.  This is obviously a bug, but there's something else odd going on:

$ ls -Zd .ssh
drwx------. luto luto unconfined_u:object_r:sandbox_file_t:s0:c70,c81 .ssh
$ restorecon -v .ssh
$ chcon -t file_t .ssh
$ restorecon -v .ssh
restorecon reset /home/luto/.ssh context unconfined_u:object_r:file_t:s0:c70,c81->unconfined_u:object_r:ssh_home_t:s0:c70,c81

restorecon -F seems to work.  Should restorecon without -F warn that it's unable to deal with the MLS labels or whatever else is going on?

Comment 1 Miroslav Grepl 2013-07-15 13:59:15 UTC
How do you use sandbox?

Comment 2 Andy Lutomirski 2013-07-15 19:03:20 UTC
Like this:

$ sandbox -X -t sandbox_net_t -W metacity -w 1300x1000 -H ~/directory command args

I can't reproduce the problem, though, so I might have triggered it with a different sandbox invocation.

Comment 3 Daniel Walsh 2013-07-15 20:54:54 UTC
Andy restorecon -FRv ~/ Would force the change.

We don't want restorecon changing sandbox_file_t by default, so it is in the customizable_types file.

 cat /etc/selinux/targeted/contexts/customizable_types 
sandbox_file_t
svirt_image_t
svirt_home_t
svirt_lxc_file_t
virt_content_t
httpd_user_htaccess_t
httpd_user_script_exec_t
httpd_user_rw_content_t
httpd_user_ra_content_t
httpd_user_content_t
git_session_content_t
home_bin_t
user_tty_device_t

These type files are not changed by default by restorecon without a force.

Maybe you could screw up your labeling with something like:

sandbox -X -t sandbox_net_t -W metacity -w 1300x1000 -H ~ command args

Comment 4 Andy Lutomirski 2013-07-15 20:56:49 UTC
I bet you're right.  I probably tried -H ~ when I was trying to use my real home directory.  Maybe that should be disallowed.

Comment 5 Fedora End Of Life 2013-09-16 16:46:33 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20


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