Bug 689134

Summary: SELinux is preventing qemu from 'read' accesses on the file /etc/localtime.
Product: [Fedora] Fedora Reporter: bill milks <wmilks>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 14CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:4c287ca315d896fdd6bbf2e2a336aa2fa897b35975381281d2f02445df9bdf55
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-21 12:02:38 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 bill milks 2011-03-19 19:05:44 UTC
SELinux is preventing qemu from 'read' accesses on the file /etc/localtime.

*****  Plugin restorecon (90.5 confidence) suggests  *************************

If you want to fix the label. 
/etc/localtime default label should be locale_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /etc/localtime

*****  Plugin qemu_file_image (9.50 confidence) suggests  ********************

If localtime is a virtualization target
Then you need to change the label on localtime'
Do
# semanage fcontext -a -t virt_image_t '/etc/localtime'
# restorecon -v '/etc/localtime'

*****  Plugin catchall (1.40 confidence) suggests  ***************************

If you believe that qemu should be allowed read access on the localtime 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 qemu /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:qemu_t:s0-s0:c0.c1023
Target Context                system_u:object_r:etc_runtime_t:s0
Target Objects                /etc/localtime [ file ]
Source                        qemu
Source Path                   qemu
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           glibc-2.13-1
Policy RPM                    selinux-policy-3.9.7-31.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.35.11-83.fc14.i686 #1 SMP Mon Feb 7 07:04:18
                              UTC 2011 i686 i686
Alert Count                   5
First Seen                    Sat 19 Mar 2011 02:28:07 PM EDT
Last Seen                     Sat 19 Mar 2011 02:40:56 PM EDT
Local ID                      ee7acf7b-5c07-43d9-a45b-1bd864b3d1d3

Raw Audit Messages
type=AVC msg=audit(1300560056.597:70): avc:  denied  { read } for  pid=4827 comm="qemu" name="localtime" dev=dm-0 ino=3847 scontext=system_u:system_r:qemu_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file


Hash: qemu,qemu_t,etc_runtime_t,file,read

audit2allow

#============= qemu_t ==============
allow qemu_t etc_runtime_t:file read;

audit2allow -R

#============= qemu_t ==============
allow qemu_t etc_runtime_t:file read;

Comment 1 Miroslav Grepl 2011-03-21 12:02:38 UTC

*** This bug has been marked as a duplicate of bug 689133 ***