Bug 891432 - SELinux is preventing systemd-readahe from read, open access on the file /usr/sbin/consoletype.
Summary: SELinux is preventing systemd-readahe from read, open access on the file /usr...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:7172583fea213d368f82baee37e...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-02 22:14 UTC by Dan Mashal
Modified: 2013-06-16 12:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-16 12:15:28 UTC
Type: ---


Attachments (Terms of Use)

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.
Do
# /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
Do
# 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.
Do
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

audit2allow

#============= 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.


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