Bug 862943

Summary: SELinux is preventing /usr/bin/python2.7 from read, write access on the file /var/lib/up2date/dbtimestamp.
Product: [Fedora] Fedora Reporter: Maurice James <midnightsteel>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:6753ae645822c9adbc7393588fb594811e1b6412c2004c6c72f32e3588851197
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-20 10:38:23 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
File: type
File: hashmarkername none

Description Maurice James 2012-10-03 21:41:44 EDT
Description of problem:
Crashes when rhnsd runs every hour

Additional info:
libreport version: 2.0.14
kernel:         3.5.4-1.fc17.x86_64

:SELinux is preventing /usr/bin/python2.7 from read, write access on the file /var/lib/up2date/dbtimestamp.
:*****  Plugin catchall_labels (83.8 confidence) suggests  ********************
:If you want to allow python2.7 to have read write access on the dbtimestamp file
:Then you need to change the label on /var/lib/up2date/dbtimestamp
:# semanage fcontext -a -t FILE_TYPE '/var/lib/up2date/dbtimestamp'
:where FILE_TYPE is one of the following: rhsmcertd_var_lib_t, rhsmcertd_var_run_t, puppet_tmp_t, rhsmcertd_t, var_lock_t, user_cron_spool_t, rhsmcertd_log_t, afs_cache_t, rhsmcertd_lock_t, root_t. 
:Then execute: 
:restorecon -v '/var/lib/up2date/dbtimestamp'
:*****  Plugin catchall (17.1 confidence) suggests  ***************************
:If you believe that python2.7 should be allowed read write access on the dbtimestamp 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 rhn_check /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:Additional Information:
:Source Context                system_u:system_r:rhsmcertd_t:s0
:Target Context                unconfined_u:object_r:var_lib_t:s0
:Target Objects                /var/lib/up2date/dbtimestamp [ file ]
:Source                        rhn_check
:Source Path                   /usr/bin/python2.7
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           python-2.7.3-7.2.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-150.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.5.4-1.fc17.x86_64 #1 SMP Mon Sep
:                              17 15:03:59 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    2012-10-03 21:40:18 EDT
:Last Seen                     2012-10-03 21:40:18 EDT
:Local ID                      7eae622f-6479-447f-a8d2-9ad6c1dfa8e6
:Raw Audit Messages
:type=AVC msg=audit(1349314818.84:6038): avc:  denied  { read write } for  pid=24393 comm="rhn_check" name="dbtimestamp" dev="dm-1" ino=3146019 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=file
:type=SYSCALL msg=audit(1349314818.84:6038): arch=x86_64 syscall=open success=no exit=EACCES a0=1319a60 a1=242 a2=1b6 a3=238 items=0 ppid=828 pid=24393 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=rhn_check exe=/usr/bin/python2.7 subj=system_u:system_r:rhsmcertd_t:s0 key=(null)
:Hash: rhn_check,rhsmcertd_t,var_lib_t,file,read,write
:#============= rhsmcertd_t ==============
:allow rhsmcertd_t var_lib_t:file { read write };
:audit2allow -R
:#============= rhsmcertd_t ==============
:allow rhsmcertd_t var_lib_t:file { read write };
Comment 1 Maurice James 2012-10-03 21:41:47 EDT
Created attachment 621224 [details]
File: type
Comment 2 Maurice James 2012-10-03 21:41:49 EDT
Created attachment 621225 [details]
File: hashmarkername
Comment 3 Miroslav Grepl 2012-10-04 03:59:43 EDT
*** Bug 862944 has been marked as a duplicate of this bug. ***
Comment 4 Miroslav Grepl 2012-10-04 03:59:50 EDT
*** Bug 862945 has been marked as a duplicate of this bug. ***
Comment 5 Miroslav Grepl 2012-10-04 04:00:23 EDT
Fixed in selinux-policy-3.10.0-152.fc17
Comment 6 Fedora Update System 2012-10-08 10:06:30 EDT
selinux-policy-3.10.0-153.fc17 has been submitted as an update for Fedora 17.
Comment 7 Fedora Update System 2012-10-08 17:57:32 EDT
Package selinux-policy-3.10.0-153.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-153.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2012-12-20 10:38:25 EST
selinux-policy-3.10.0-153.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.