Bug 1554513

Summary: SELinux is preventing dmidecode from 'map' accesses on the file /etc/ld.so.cache.
Product: [Fedora] Fedora Reporter: andy_c
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: dwalsh, lvrabec, mgrepl, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:87346b03dfcb253fa09ca4dd58aad3148cadeef0539f6c6cb57074c4e198ac71;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-13 09:53: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 andy_c 2018-03-12 20:13:36 UTC
Description of problem:
SELinux is preventing dmidecode from 'map' accesses on the file /etc/ld.so.cache.

*****  Plugin restorecon (94.8 confidence) suggests   ************************

If you want to fix the label. 
/etc/ld.so.cache default label should be ld_so_cache_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /etc/ld.so.cache

*****  Plugin catchall_labels (5.21 confidence) suggests   *******************

If you want to allow dmidecode to have map access on the ld.so.cache file
Then you need to change the label on /etc/ld.so.cache
Do
# semanage fcontext -a -t FILE_TYPE '/etc/ld.so.cache'
where FILE_TYPE is one of the following: dmidecode_exec_t, fonts_cache_t, fonts_t, ld_so_cache_t, ld_so_t, lib_t, locale_t, prelink_exec_t, textrel_shlib_t.
Then execute:
restorecon -v '/etc/ld.so.cache'


*****  Plugin catchall (1.44 confidence) suggests   **************************

If you believe that dmidecode should be allowed map access on the ld.so.cache 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:
# ausearch -c 'dmidecode' --raw | audit2allow -M my-dmidecode
# semodule -X 300 -i my-dmidecode.pp

Additional Information:
Source Context                system_u:system_r:dmidecode_t:s0-s0:c0.c1023
Target Context                system_u:object_r:etc_t:s0
Target Objects                /etc/ld.so.cache [ file ]
Source                        dmidecode
Source Path                   dmidecode
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           glibc-2.26-26.fc27.x86_64 glibc-2.26-26.fc27.i686
Policy RPM                    selinux-policy-3.13.1-283.26.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.15.6-300.fc27.x86_64 #1 SMP Mon
                              Feb 26 18:43:03 UTC 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-03-12 16:01:35 EDT
Last Seen                     2018-03-12 16:01:35 EDT
Local ID                      2d9408e2-b5ef-413c-a6ac-167f8dfad2cc

Raw Audit Messages
type=AVC msg=audit(1520884895.405:196): avc:  denied  { map } for  pid=1884 comm="dmidecode" path="/etc/ld.so.cache" dev="dm-1" ino=1050448 scontext=system_u:system_r:dmidecode_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file permissive=0


Hash: dmidecode,dmidecode_t,etc_t,file,map

Version-Release number of selected component:
selinux-policy-3.13.1-283.26.fc27.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.3
hashmarkername: setroubleshoot
kernel:         4.15.6-300.fc27.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2018-03-13 09:53:02 UTC
*** Bug 1554514 has been marked as a duplicate of this bug. ***

Comment 2 Lukas Vrabec 2018-03-13 09:53:25 UTC

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