Bug 1072015 - SELinux is preventing /usr/bin/python2.7 from 'search' accesses on the directory .
Summary: SELinux is preventing /usr/bin/python2.7 from 'search' accesses on the direct...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:917b739f6c1df574b234658c917...
: 1072012 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-03 16:51 UTC by Chester Knapp
Modified: 2014-07-21 04:26 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-03-07 22:29:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: packstack-answers-20140303-103051.txt (14.51 KB, text/plain)
2014-03-03 16:51 UTC, Chester Knapp
no flags Details

Description Chester Knapp 2014-03-03 16:51:38 UTC
Description of problem:
Happened during RDO installation. 
SELinux is preventing /usr/bin/python2.7 from 'search' accesses on the directory .

*****  Plugin file (36.8 confidence) suggests   ******************************

If you think this is caused by a badly mislabeled machine.
Then you need to fully relabel.
Do
touch /.autorelabel; reboot

*****  Plugin file (36.8 confidence) suggests   ******************************

If you think this is caused by a badly mislabeled machine.
Then you need to fully relabel.
Do
touch /.autorelabel; reboot

*****  Plugin catchall_labels (23.2 confidence) suggests   *******************

If you want to allow python2.7 to have search access on the  directory
Then you need to change the label on $FIX_TARGET_PATH
Do
# semanage fcontext -a -t FILE_TYPE '$FIX_TARGET_PATH'
where FILE_TYPE is one of the following: abrt_var_run_t, avahi_var_run_t, bin_t, boot_t, cert_t, cluster_conf_t, cluster_var_lib_t, cluster_var_run_t, cpu_online_t, default_context_t, default_t, device_t, devpts_t, etc_t, fail2ban_var_lib_t, file_context_t, httpd_sys_content_t, init_var_run_t, krb5_conf_t, krb5_host_rcache_t, lib_t, likewise_var_lib_t, locale_t, man_cache_t, man_t, mandb_cache_t, mnt_t, net_conf_t, nscd_var_run_t, nslcd_var_run_t, pcscd_var_run_t, proc_t, rkhunter_var_lib_t, root_t, rpm_log_t, rpm_script_tmp_t, samba_etc_t, samba_var_t, security_t, selinux_config_t, setrans_var_run_t, shell_exec_t, smbd_var_run_t, sosreport_tmp_t, src_t, sssd_public_t, sssd_var_lib_t, swift_data_t, swift_var_cache_t, swift_var_run_t, sysctl_t, sysfs_t, syslogd_var_run_t, system_conf_t, system_db_t, textrel_shlib_t, tmp_t, usr_t, var_lib_t, var_log_t, var_run_t, var_t, winbind_var_run_t. 
Then execute: 
restorecon -v '$FIX_TARGET_PATH'


*****  Plugin catchall (5.04 confidence) suggests   **************************

If you believe that python2.7 should be allowed search access on the  directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep swift-account-r /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:swift_t:s0
Target Context                system_u:object_r:file_t:s0
Target Objects                 [ dir ]
Source                        swift-account-r
Source Path                   /usr/bin/python2.7
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7.5-11.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-122.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.13.5-200.fc20.x86_64 #1 SMP Mon
                              Feb 24 16:51:35 UTC 2014 x86_64 x86_64
Alert Count                   8
First Seen                    2014-03-03 11:49:23 EST
Last Seen                     2014-03-03 11:50:24 EST
Local ID                      0aac2898-f747-417f-9195-d9a1bb97ec8e

Raw Audit Messages
type=AVC msg=audit(1393865424.546:18147): avc:  denied  { search } for  pid=29179 comm="swift-object-re" name="/" dev="loop1" ino=2 scontext=system_u:system_r:swift_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir


type=SYSCALL msg=audit(1393865424.546:18147): arch=x86_64 syscall=openat success=no exit=EACCES a0=ffffffffffffff9c a1=1661f90 a2=90800 a3=0 items=0 ppid=1 pid=29179 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm=swift-object-re exe=/usr/bin/python2.7 subj=system_u:system_r:swift_t:s0 key=(null)

Hash: swift-account-r,swift_t,file_t,dir,search

Additional info:
reporter:       libreport-2.1.12
hashmarkername: setroubleshoot
kernel:         3.13.5-200.fc20.x86_64
type:           libreport

Comment 1 Chester Knapp 2014-03-03 16:51:42 UTC
Created attachment 870047 [details]
File: packstack-answers-20140303-103051.txt

Comment 2 Miroslav Grepl 2014-03-05 08:28:16 UTC
There is another bug for this issue.

What does

# fixfiles restore

Comment 3 Chester Knapp 2014-03-05 15:13:59 UTC
(In reply to Miroslav Grepl from comment #2)
> There is another bug for this issue.
> 
> What does
> 
> # fixfiles restore

[root@dhcp-161-221 ~(keystone_admin)]# fixfiles restore
Relabeling / /boot /dev /dev/hugepages /dev/mqueue /dev/pts /dev/shm /run /srv/node/device1 /sys /sys/fs/cgroup /tmp
68.4%
Cleaning up labels on /tmp
[root@dhcp-161-221 ~(keystone_admin)]#

Comment 4 Daniel Walsh 2014-03-07 22:29:40 UTC
You should be all set now.

You had a disk without labels.

Comment 5 Miroslav Grepl 2014-03-10 09:31:40 UTC
*** Bug 1072012 has been marked as a duplicate of this bug. ***


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