Bug 1412727 - USER_AVC when enabling/disabling a non-existent service
Summary: USER_AVC when enabling/disabling a non-existent service
Keywords:
Status: CLOSED DUPLICATE of bug 1337041
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-12 16:07 UTC by Frantisek Sumsal
Modified: 2017-01-12 16:28 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-12 16:28:51 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Frantisek Sumsal 2017-01-12 16:07:42 UTC
Description of problem:
Enabling/disabling a non-existent service causes "Failed to execute operation: Access denied" error being thrown along with a USER_AVC. This is a possible regression, see BZ#1154065.

Version-Release number of selected component (if applicable):
systemd-219-30.el7.x86_64
selinux-policy-3.13.1-108.el7.noarch

How reproducible:
always

Steps to Reproduce:
# systemctl status definitely-a-non-existent-service.service
Unit definitely-a-non-existent-service.service could not be found.
# systemctl enable definitely-a-non-existent-service.service
Failed to execute operation: Access denied
# systemctl disable definitely-a-non-existent-service.service
Failed to execute operation: Access denied
# ausearch -m USER_AVC -i
----
type=USER_AVC msg=audit(01/12/2017 11:02:53.361:307) : pid=1 uid=root auid=unset ses=unset subj=system_u:system_r:init_t:s0 msg='avc:  denied  { enable } for auid=root uid=root gid=root cmdline="systemctl enable definitely-a-non-existent-service.service" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:system_r:init_t:s0 tclass=service  exe=/usr/lib/systemd/systemd sauid=root hostname=? addr=? terminal=?' 
----
type=USER_AVC msg=audit(01/12/2017 11:02:55.839:308) : pid=1 uid=root auid=unset ses=unset subj=system_u:system_r:init_t:s0 msg='avc:  denied  { disable } for auid=root uid=root gid=root cmdline="systemctl disable definitely-a-non-existent-service.service" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:system_r:init_t:s0 tclass=service  exe=/usr/lib/systemd/systemd sauid=root hostname=? addr=? terminal=?'

Expected results:
# setenforce 0
# systemctl enable definitely-a-non-existent-service.service
Failed to execute operation: No such file or directory
# systemctl disable definitely-a-non-existent-service.service
Failed to execute operation: No such file or directory

Comment 1 Milos Malik 2017-01-12 16:23:47 UTC
I believe this bug is duplicate of BZ#1337041.

Comment 2 Milos Malik 2017-01-12 16:25:40 UTC
Please see comment#6 in BZ#1337041.

Comment 3 Frantisek Sumsal 2017-01-12 16:28:51 UTC
Thank you, Milos, it's indeed the exactly same problem.

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


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