Bug 1595187 - SELinux is preventing /usr/libexec/upowerd from 'open' accesses on the chr_file /dev/input/event0.
Summary: SELinux is preventing /usr/libexec/upowerd from 'open' accesses on the chr_fi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 29
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:fb27a116959c6b2ccc6622598b1...
: 1599067 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-26 10:31 UTC by Lukas Slebodnik
Modified: 2018-09-12 02:57 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.14.2-34.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-12 02:57:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Lukas Slebodnik 2018-06-26 10:31:00 UTC
Description of problem:
SELinux is preventing /usr/libexec/upowerd from 'open' accesses on the chr_file /dev/input/event0.

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

If you believe that upowerd should be allowed open access on the event0 chr_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 'upowerd' --raw | audit2allow -M my-upowerd
# semodule -X 300 -i my-upowerd.pp

Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:object_r:event_device_t:s0
Target Objects                /dev/input/event0 [ chr_file ]
Source                        upowerd
Source Path                   /usr/libexec/upowerd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           upower-0.99.8-1.fc29.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.2-25.fc29.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.16.16-300.fc28.x86_64 #1 SMP Sun
                              Jun 17 03:02:42 UTC 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-06-26 12:26:44 CEST
Last Seen                     2018-06-26 12:26:44 CEST
Local ID                      e03f2cd4-7aa3-424a-ac42-57ee711d395b

Raw Audit Messages
type=AVC msg=audit(1530008804.577:325): avc:  denied  { open } for  pid=2754 comm="upowerd" path="/dev/input/event0" dev="devtmpfs" ino=1185 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:event_device_t:s0 tclass=chr_file permissive=0


type=SYSCALL msg=audit(1530008804.577:325): arch=x86_64 syscall=openat success=no exit=EACCES a0=ffffff9c a1=558eebcc0240 a2=800 a3=0 items=1 ppid=1 pid=2754 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=upowerd exe=/usr/libexec/upowerd subj=system_u:system_r:init_t:s0 key=(null)

type=CWD msg=audit(1530008804.577:325): cwd=/

type=PATH msg=audit(1530008804.577:325): item=0 name=/dev/input/event0 inode=1185 dev=00:06 mode=020660 ouid=0 ogid=999 rdev=0d:40 obj=system_u:object_r:event_device_t:s0 nametype=NORMAL cap_fp=0000000000000000 cap_fi=0000000000000000 cap_fe=0 cap_fver=0

Hash: upowerd,init_t,event_device_t,chr_file,open

Version-Release number of selected component:
selinux-policy-3.14.2-25.fc29.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.5
hashmarkername: setroubleshoot
kernel:         4.16.16-300.fc28.x86_64
type:           libreport

Potential duplicate: bug 1594554

Comment 1 Franco Geller 2018-06-27 17:15:56 UTC
Same problem here, since 4.17.2-100.fc27.x86_64 kernel update.
The upower.service throws the following log:

upowerd[1216]: failed to get data: Failed to open file “/var/lib/upower/history-rate-ASUS_Battery-56.dat”: Permission denied
upowerd[1216]: failed to get data: Failed to open file “/var/lib/upower/history-charge-ASUS_Battery-56.dat”: Permission denied
upowerd[1216]: failed to get data: Failed to open file “/var/lib/upower/history-time-full-ASUS_Battery-56.dat”: Permission denied
upowerd[1216]: failed to get data: Failed to open file “/var/lib/upower/history-time-empty-ASUS_Battery-56.dat”: Permission denied
upowerd[1216]: cannot open '/dev/input/event0': Permission denied
systemd[1]: Started Daemon for power management.
upowerd[1216]: Failed to create object manager for BlueZ: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An SELinux policy prevents this sender from sending this message to this recipie
upowerd[1216]: failed to set data: Failed to create file “/var/lib/upower/history-rate-ASUS_Battery-56.dat.YG3MLZ”: Permission denied
upowerd[1216]: failed to set data: Failed to create file “/var/lib/upower/history-rate-ASUS_Battery-56.dat.MUMMLZ”: Permission denied
upowerd[1216]: failed to set data: Failed to create file “/var/lib/upower/history-rate-ASUS_Battery-56.dat.AI59KZ”: Permission denied

Comment 2 Lukas Vrabec 2018-07-24 16:20:59 UTC
*** Bug 1599067 has been marked as a duplicate of this bug. ***

Comment 3 Jan Kurik 2018-08-14 11:18:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 4 Fedora Update System 2018-09-11 12:51:20 UTC
selinux-policy-3.14.2-34.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-db240a1726

Comment 5 Fedora Update System 2018-09-12 02:57:41 UTC
selinux-policy-3.14.2-34.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.