Bug 504315 - setroubleshoot: SELinux is preventing vim (sandbox_t) "write" to /home/tliu/v57883 (user_home_dir_t).
Summary: setroubleshoot: SELinux is preventing vim (sandbox_t) "write" to /home/t...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 11
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:05585270437...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-05 14:46 UTC by Thomas Liu
Modified: 2009-08-03 15:40 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-08-03 15:40:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Thomas Liu 2009-06-05 14:46:56 UTC
The following was filed automatically by setroubleshoot:

Summary:

SELinux is preventing vim (sandbox_t) "write" to /home/tliu/v57883
(user_home_dir_t).

Detailed Description:

SELinux denied access requested by vim. /home/tliu/v57883 may be a mislabeled.
/home/tliu/v57883 default SELinux type is user_home_t, but its current type is
user_home_dir_t. Changing this file back to the default type, may fix your
problem.

File contexts can be assigned to a file in the following ways.

  * Files created in a directory receive the file context of the parent
    directory by default.
  * The SELinux policy might override the default label inherited from the
    parent directory by specifying a process running in context A which creates
    a file in a directory labeled B will instead create the file with label C.
    An example of this would be the dhcp client running with the dhclient_t type
    and creates a file in the directory /etc. This file would normally receive
    the etc_t type due to parental inheritance but instead the file is labeled
    with the net_conf_t type because the SELinux policy specifies this.
  * Users can change the file context on a file using tools such as chcon, or
    restorecon.

This file could have been mislabeled either by user error, or if an normally
confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not
have been labeled with this type.

If you believe this is a bug, please file a bug report
(http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this package.

Allowing Access:

You can restore the default system context to this file by executing the
restorecon command. restorecon '/home/tliu/v57883', if this file is a directory,
you can recursively restore using restorecon -R '/home/tliu/v57883'.

Fix Command:

restorecon '/home/tliu/v57883'

Additional Information:

Source Context                unconfined_u:unconfined_r:sandbox_t:s0:c22,c676
Target Context                unconfined_u:object_r:user_home_dir_t:s0
Target Objects                /home/tliu/v57883 [ dir ]
Source                        vim
Source Path                   /usr/bin/vim
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           vim-enhanced-7.2.148-1.fc11
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.12-45.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   restorecon
Host Name                     (removed)
Platform                      Linux Ares 2.6.29.4-167.fc11.i586 #1 SMP Wed May
                              27 17:14:37 EDT 2009 i686 i686
Alert Count                   1
First Seen                    Wed 03 Jun 2009 02:27:55 PM EDT
Last Seen                     Wed 03 Jun 2009 02:27:55 PM EDT
Local ID                      ee25bdd9-00aa-42b3-88ef-93018a1fa5a0
Line Numbers                  

Raw Audit Messages            

node=Ares type=AVC msg=audit(1244053675.549:249): avc:  denied  { write } for  pid=4208 comm="vim" name="tliu" dev=dm-1 ino=201 scontext=unconfined_u:unconfined_r:sandbox_t:s0:c22,c676 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir

node=Ares type=SYSCALL msg=audit(1244053675.549:249): arch=40000003 syscall=39 success=no exit=-13 a0=bfaad17c a1=1c0 a2=bfaad17c a3=0 items=1 ppid=4207 pid=4208 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=pts2 ses=1 comm="vim" exe="/usr/bin/vim" subj=unconfined_u:unconfined_r:sandbox_t:s0:c22,c676 key=(null)

node=Ares type=CWD msg=audit(1244053675.549:249): cwd="/"

node=Ares type=PATH msg=audit(1244053675.549:249): item=0 name="/home/tliu/v57883" inode=201 dev=fd:01 mode=040700 ouid=500 ogid=500 rdev=00:00 obj=unconfined_u:object_r:user_home_dir_t:s0


audit2allow suggests:

#============= sandbox_t ==============
allow sandbox_t user_home_dir_t:dir write;


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