Bug 2183208

Summary: Frequent SELinux security alerts with geoclue 2.7.0
Product: [Fedora] Fedora Reporter: Ben Cotton <bcotton>
Component: geoclue2Assignee: Neal Gompa <ngompa13>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 38CC: gnome-sig, kde-sig, klember, ngompa13, zeenix
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-03-30 15:17:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Cotton 2023-03-30 15:06:27 UTC
After updating to geoclue 2.7.0 this morning, I'm getting SELinux alerts every few seconds:

SELinux is preventing geoclue from watch access on the directory /etc.

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

If you want to allow geoclue 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 geoclue 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 'geoclue' --raw | audit2allow -M my-geoclue
# semodule -X 300 -i my-geoclue.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                        geoclue
Source Path                   geoclue
Port                          <Unknown>
Host                          fedora
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-38.9-1.fc38.noarch
Local Policy RPM              selinux-policy-targeted-38.9-1.fc38.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     fedora
Platform                      Linux fedora 6.2.8-300.fc38.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Wed Mar 22 19:29:30 UTC 2023
                              x86_64
Alert Count                   13
First Seen                    2023-03-30 11:01:38 EDT
Last Seen                     2023-03-30 11:02:26 EDT
Local ID                      1ef86eed-f172-403d-b405-9020e8963978

Raw Audit Messages
type=AVC msg=audit(1680188546.386:445): avc:  denied  { watch } for  pid=31145 comm="gmain" path="/etc" dev="dm-0" ino=269 scontext=system_u:system_r:geoclue_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=dir permissive=0


Hash: geoclue,geoclue_t,etc_t,dir,watch

Comment 1 Ben Cotton 2023-03-30 15:17:08 UTC
Ah, looks like a duplicate of 2183190. Marking as such.

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