Bug 2184515

Summary: SELinux is preventing gmain from 'watch' accesses on the directory /etc.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, lvrabec, mikhail.v.gavrilov, mmalik, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:b0a61fcd0efacb44cd668655792f619b834ca02fbdf3ac994338105a65ecc39e;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-04-05 06:30:22 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:
Attachments:
Description Flags
File: description
none
File: os_info none

Description Mikhail 2023-04-04 21:22:05 UTC
Description of problem:
SELinux is preventing gmain from 'watch' accesses on the directory /etc.

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow gmain to have watch access on the etc directory
Then you need to change the label on /etc
Do
# semanage fcontext -a -t FILE_TYPE '/etc'
where FILE_TYPE is one of the following: geoclue_tmp_t, geoclue_var_lib_t.
Then execute:
restorecon -v '/etc'


*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that gmain should be allowed watch access on the etc directory 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 'gmain' --raw | audit2allow -M my-gmain
# semodule -X 300 -i my-gmain.pp

Additional Information:
Source Context                system_u:system_r:geoclue_t:s0
Target Context                system_u:object_r:etc_t:s0
Target Objects                /etc [ dir ]
Source                        gmain
Source Path                   gmain
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-38.9-1.fc39.noarch
Local Policy RPM              selinux-policy-targeted-38.9-1.fc39.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.3.0-0.rc5.42.fc39.x86_64+debug
                              #1 SMP PREEMPT_DYNAMIC Tue Apr 4 03:37:52 +05 2023
                              x86_64
Alert Count                   9
First Seen                    2023-04-05 02:21:26 +05
Last Seen                     2023-04-05 02:21:42 +05
Local ID                      b04c4aab-a9fe-4097-93d9-0d26d5b8e387

Raw Audit Messages
type=AVC msg=audit(1680643302.527:229): avc:  denied  { watch } for  pid=1403 comm="gmain" path="/etc" dev="nvme0n1p3" ino=271 scontext=system_u:system_r:geoclue_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=dir permissive=0


Hash: gmain,geoclue_t,etc_t,dir,watch

Version-Release number of selected component:
selinux-policy-targeted-38.9-1.fc39.noarch

Additional info:
reporter:       libreport-2.17.9
reason:         SELinux is preventing gmain from 'watch' accesses on the directory /etc.
package:        selinux-policy-targeted-38.9-1.fc39.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.3.0-0.rc5.42.fc39.x86_64+debug
component:      selinux-policy

Comment 1 Mikhail 2023-04-04 21:22:08 UTC
Created attachment 1955750 [details]
File: description

Comment 2 Mikhail 2023-04-04 21:22:10 UTC
Created attachment 1955751 [details]
File: os_info

Comment 3 Zdenek Pytela 2023-04-05 06:30:22 UTC

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