Bug 891432

Summary: SELinux is preventing systemd-readahe from read, open access on the file /usr/sbin/consoletype.
Product: [Fedora] Fedora Reporter: Dan Mashal <dan.mashal>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:7172583fea213d368f82baee37efac0709b350f6f4213929fe7893b28274e17e
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-16 12:15:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dan Mashal 2013-01-02 22:14:23 UTC
Description of problem:
SELinux is preventing systemd-readahe from read, open access on the file /usr/sbin/consoletype.

*****  Plugin restorecon (94.8 confidence) suggests  *************************

If you want to fix the label. 
/usr/sbin/consoletype default label should be bin_t.
Then you can run restorecon.
# /sbin/restorecon -v /usr/sbin/consoletype

*****  Plugin catchall_labels (5.21 confidence) suggests  ********************

If you want to allow systemd-readahe to have read open access on the consoletype file
Then you need to change the label on /usr/sbin/consoletype
# semanage fcontext -a -t FILE_TYPE '/usr/sbin/consoletype'
where FILE_TYPE is one of the following: rpm_script_tmp_t, ld_so_cache_t, readahead_t, machineid_t, abrt_var_run_t, etc_runtime_t, sysctl_crypto_t, domain, anon_inodefs_t, readahead_var_lib_t, readahead_var_run_t, locale_t, ld_so_t, abrt_t, base_ro_file_type, lib_t, man_t, sysctl_type, sysctl_vm_overcommit_t, cpu_online_t, mandb_cache_t, cgroup_t, sysfs_t, tmpfs_t, abrt_helper_exec_t, fail2ban_var_lib_t, proc_t, non_security_file_type, textrel_shlib_t, readahead_exec_t, sysctl_kernel_t, prelink_exec_t. 
Then execute: 
restorecon -v '/usr/sbin/consoletype'

*****  Plugin catchall (1.44 confidence) suggests  ***************************

If you believe that systemd-readahe should be allowed read open access on the consoletype file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep systemd-readahe /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:readahead_t:s0
Target Context                system_u:object_r:unlabeled_t:s0
Target Objects                /usr/sbin/consoletype [ file ]
Source                        systemd-readahe
Source Path                   systemd-readahe
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           initscripts-9.42.1-1.fc18.x86_64
Policy RPM                    selinux-policy-3.11.1-67.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.6.11-3.fc18.x86_64 #1 SMP Mon
                              Dec 17 21:35:39 UTC 2012 x86_64 x86_64
Alert Count                   1
First Seen                    2013-01-02 14:12:50 PST
Last Seen                     2013-01-02 14:12:50 PST
Local ID                      78ef991b-d595-4704-a925-9c57eadbdd68

Raw Audit Messages
type=AVC msg=audit(1357164770.770:313): avc:  denied  { read open } for  pid=355 comm="systemd-readahe" path="/usr/sbin/consoletype" dev="sda1" ino=1452893 scontext=system_u:system_r:readahead_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file

Hash: systemd-readahe,readahead_t,unlabeled_t,file,read,open


#============= readahead_t ==============
allow readahead_t unlabeled_t:file { read open };

audit2allow -R

#============= readahead_t ==============
allow readahead_t unlabeled_t:file { read open };

Additional info:
hashmarkername: setroubleshoot
kernel:         3.6.11-3.fc18.x86_64
type:           libreport

Potential duplicate: bug 739324

Comment 1 Miroslav Grepl 2013-01-03 09:21:45 UTC
Could you try to reinstall the policy. It should not happen.

Comment 2 Dan Mashal 2013-01-03 13:32:17 UTC
Will do.

Comment 3 Dan Mashal 2013-06-16 12:15:28 UTC
No longer experiencing this at this time.