Bug 2336622

Summary: SELinux is preventing iio-sensor-prox from 'add_name' accesses on the directory enable.
Product: [Fedora] Fedora Reporter: Ali Akbar Babaei <aliakbarbabaee13>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 41CC: aliakbarbabaee13, dwalsh, lvrabec, mmalik, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:1925a11d08d30e449994d5d70d14eba6be70433319fe6faa1c9ca6cc199de0bf;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-01-27 14:21: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 Ali Akbar Babaei 2025-01-09 17:22:31 UTC
Description of problem:
Hi
My laptop is lenovo thinkbook 14 g6+ and it has automatic screen brightness sensor and gnome desktop environment supports it was enable in fedora 40  when i upgrade to fedora 41 it disabled, but i enabled it manually and selinux preventing it, i created this rule:
# ausearch -c 'iio-sensor-prox' --raw | audit2allow -M my-iiosensorprox
# semodule -X 300 -i my-iiosensorprox.pp
but it still prevents it.
just with disabling the selinux fixes it.
SELinux is preventing iio-sensor-prox from 'add_name' accesses on the directory enable.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that iio-sensor-prox should be allowed add_name access on the enable 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 'iio-sensor-prox' --raw | audit2allow -M my-iiosensorprox
# semodule -X 300 -i my-iiosensorprox.pp

Additional Information:
Source Context                system_u:system_r:iiosensorproxy_t:s0
Target Context                system_u:object_r:sysfs_t:s0
Target Objects                enable [ dir ]
Source                        iio-sensor-prox
Source Path                   iio-sensor-prox
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-41.27-1.fc41.noarch
Local Policy RPM              selinux-policy-targeted-41.27-1.fc41.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.12.7-200.fc41.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Fri Dec 27 17:05:33 UTC 2024
                              x86_64
Alert Count                   189
First Seen                    2024-12-18 16:41:18 +0330
Last Seen                     2025-01-09 18:42:26 +0330
Local ID                      747ee619-fd28-4968-81ea-a86dabceb097

Raw Audit Messages
type=AVC msg=audit(1736435546.651:121): avc:  denied  { add_name } for  pid=1121 comm="iio-sensor-prox" name="enable" scontext=system_u:system_r:iiosensorproxy_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=0


Hash: iio-sensor-prox,iiosensorproxy_t,sysfs_t,dir,add_name

Version-Release number of selected component:
selinux-policy-targeted-41.27-1.fc41.noarch

Additional info:
reporter:       libreport-2.17.15
reason:         SELinux is preventing iio-sensor-prox from 'add_name' accesses on the directory enable.
package:        selinux-policy-targeted-41.27-1.fc41.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.12.7-200.fc41.x86_64
component:      selinux-policy

Comment 1 Ali Akbar Babaei 2025-01-09 17:22:34 UTC
Created attachment 2065326 [details]
File: description

Comment 2 Ali Akbar Babaei 2025-01-09 17:22:36 UTC
Created attachment 2065327 [details]
File: os_info

Comment 3 Zdenek Pytela 2025-01-27 14:21:22 UTC

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