Bug 831385

Summary: SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file /var/lib/rpm/Packages.
Product: [Fedora] Fedora Reporter: sebastián Natanael Barceló <snbglu>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG 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:4e7a9df020ef61d8bd2231aa3b0130a2ee51413f8600f84e15ba413ea1a7534c
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-13 00:58:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sebastián Natanael Barceló 2012-06-12 22:21:07 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.4.0-1.fc17.x86_64
time:           mar 12 jun 2012 19:18:11 ART

description:
:SELinux is preventing /usr/bin/bash from 'getattr' accesses on the file /var/lib/rpm/Packages.
:
:*****  Plugin restorecon (99.5 confidence) suggests  *************************
:
:If desea arreglar la etiqueta .
:La etiqueta predeterminada de /var/lib/rpm/Packages debería ser rpm_var_lib_t.
:Then puede ejecutar restorecon.
:Do
:# /sbin/restorecon -v /var/lib/rpm/Packages
:
:*****  Plugin catchall (1.49 confidence) suggests  ***************************
:
:If cree que de manera predeterminada, bash debería permitir acceso getattr sobre  Packages file.     
:Then debería reportar esto como un error.
:Puede generar un módulo de política local para permitir este acceso.
:Do
:permita el acceso momentáneamente executando:
:# grep prelink /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:prelink_cron_system_t:s0-s0:c0.c
:                              1023
:Target Context                system_u:object_r:etc_runtime_t:s0
:Target Objects                /var/lib/rpm/Packages [ file ]
:Source                        prelink
:Source Path                   /usr/bin/bash
:Port                          <Desconocido>
:Host                          (removed)
:Source RPM Packages           
:Target RPM Packages           
:Policy RPM                    <Desconocido>
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.4.0-1.fc17.x86_64 #1 SMP Sun
:                              Jun 3 06:35:17 UTC 2012 x86_64 x86_64
:Alert Count                   2
:First Seen                    mar 12 jun 2012 03:15:25 ART
:Last Seen                     mar 12 jun 2012 03:15:25 ART
:Local ID                      97a7a835-a1ec-4fee-8b0c-6a52a107f79b
:
:Raw Audit Messages
:type=AVC msg=audit(1339481725.418:146): avc:  denied  { getattr } for  pid=8208 comm="prelink" path="/var/lib/rpm/Packages" dev="dm-1" ino=2883607 scontext=system_u:system_r:prelink_cron_system_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1339481725.418:146): arch=x86_64 syscall=stat success=no exit=EACCES a0=1281a40 a1=7fff21ab2c50 a2=7fff21ab2c50 a3=1281a40 items=0 ppid=6190 pid=8208 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=10 comm=prelink exe=/usr/bin/bash subj=system_u:system_r:prelink_cron_system_t:s0-s0:c0.c1023 key=(null)
:
:Hash: prelink,prelink_cron_system_t,etc_runtime_t,file,getattr
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Daniel Walsh 2012-06-13 00:58:25 UTC
/var/lib/rpm is mislabed.

restorecon -R -v /var/lib/rpm


Did you have some init script create this directory and mv it to /var/lib?