Bug 750770

Summary: SELinux is preventing systemd-readahe from 'unlink' accesses on the fichier .readahead.
Product: [Fedora] Fedora Reporter: John Mev <zikamev>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:81e81e1f50e18d6221cf5afac332ce556f6b32c981776db44930dd6b1a6d5d25
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-02 15:12:47 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 John Mev 2011-11-02 10:50:59 UTC
SELinux is preventing systemd-readahe from 'unlink' accesses on the fichier .readahead.

*****  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 vous souhaitez autoriser systemd-readahe à accéder à unlink sur .readahead file
Then you need to change the label on .readahead
Do
# semanage fcontext -a -t FILE_TYPE '.readahead'
where FILE_TYPE is one of the following: etc_runtime_t, readahead_var_lib_t, readahead_var_run_t, root_t. 
Then execute: 
restorecon -v '.readahead'


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

If you believe that systemd-readahe should be allowed unlink access on the .readahead 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:file_t:s0
Target Objects                .readahead [ file ]
Source                        systemd-readahe
Source Path                   systemd-readahe
Port                          <Inconnu>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-44.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.40.6-0.fc15.i686.PAE
                              #1 SMP Tue Oct 4 00:44:38 UTC 2011 i686 i686
Alert Count                   1
First Seen                    mer. 02 nov. 2011 10:39:31 CET
Last Seen                     mer. 02 nov. 2011 10:39:31 CET
Local ID                      3051511d-71c3-4c79-a9e4-857743ce5203

Raw Audit Messages
type=AVC msg=audit(1320226771.636:50): avc:  denied  { unlink } for  pid=488 comm="systemd-readahe" name=".readahead" dev=sdb12 ino=3286 scontext=system_u:system_r:readahead_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file


Hash: systemd-readahe,readahead_t,file_t,file,unlink

audit2allow

#============= readahead_t ==============
allow readahead_t file_t:file unlink;

audit2allow -R

#============= readahead_t ==============
allow readahead_t file_t:file unlink;

Comment 1 Miroslav Grepl 2011-11-02 12:50:47 UTC
Where is .readahead located? Did you add a new disk?

Comment 2 Daniel Walsh 2011-11-02 15:12:35 UTC
file_t means that the file has no label if you added a new disk, you need to place labels on it,  restorecon -r -v PATHTODISK will do this.

touch /.autorelebel; reboot

Will place labels oll over the disk.  If the .readahed file is on /tmp, you should just remove it.

Comment 3 John Mev 2011-11-03 07:54:44 UTC
No I didn't add any disk, but I just changed and format a partition ton reinstall a backup of F 15.

So I just need to autorelabel ?

thx

Comment 4 Daniel Walsh 2011-11-03 14:56:54 UTC
Yes

Comment 5 John Mev 2011-11-04 07:33:47 UTC
I'll do it

thx