Bug 1291940 - SELinux is preventing systemd from 'create' accesses on the unix_stream_socket Unknown.
Summary: SELinux is preventing systemd from 'create' accesses on the unix_stream_socke...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 26
Hardware: x86_64
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedBlocker abrt_hash:3105d14f21e...
: 1293722 1296309 1299805 (view as bug list)
Depends On:
Blocks: F24FinalBlocker 1290357 1325503
TreeView+ depends on / blocked
 
Reported: 2015-12-15 22:45 UTC by Vít Ondruch
Modified: 2018-06-16 22:52 UTC (History)
31 users (show)

Fixed In Version: selinux-policy-3.13.1-167.fc24 selinux-policy-3.13.1-179.fc24
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-29 11:53:05 UTC


Attachments (Terms of Use)
libvirt selinux bugfix module (1.29 KB, application/octet-stream)
2018-06-16 22:52 UTC, user
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1290357 None CLOSED virtlogd is not started/enabled on fresh libvirt install 2019-05-05 08:43:28 UTC

Internal Links: 1290357

Description Vít Ondruch 2015-12-15 22:45:15 UTC
Description of problem:
SELinux is preventing systemd from 'create' accesses on the unix_stream_socket Unknown.

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

If you believe that systemd should be allowed create access on the Unknown unix_stream_socket 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:
# grep systemd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:system_r:unconfined_service_t:s0
Target Objects                Unknown [ unix_stream_socket ]
Source                        systemd
Source Path                   systemd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-163.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.3.0-1.fc24.x86_64 #1 SMP Mon Nov
                              2 16:27:20 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-12-15 23:42:46 CET
Last Seen                     2015-12-15 23:42:46 CET
Local ID                      feac16a5-8fa5-410f-b3bc-24a512ae44f7

Raw Audit Messages
type=AVC msg=audit(1450219366.938:83): avc:  denied  { create } for  pid=1 comm="systemd" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=unix_stream_socket permissive=0


Hash: systemd,init_t,unconfined_service_t,unix_stream_socket,create

Version-Release number of selected component:
selinux-policy-3.13.1-163.fc24.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.3.0-1.fc24.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2015-12-15 22:54:30 UTC
After boot?

What does show

rpm -q systemd

ps -efZ |grep unconfined_service_t

?

Comment 2 Vít Ondruch 2015-12-17 15:04:17 UTC
(In reply to Miroslav Grepl from comment #1)
> After boot?

Yes, always

> rpm -q systemd

$ rpm -q systemd
systemd-228-6.gite35a787.fc24.x86_64

> ps -efZ |grep unconfined_service_t

$ ps -efZ |grep unconfined_service_t
system_u:system_r:unconfined_service_t:s0 root 1770 1  0 16:01 ?       00:00:00 /usr/libexec/udisks2/udisksd --no-debug
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 vondruch 3113 2720  0 16:03 pts/0 00:00:00 grep --color=auto unconfined_service_t

Comment 3 Jared Smith 2015-12-28 13:13:14 UTC
Description of problem:
Not sure...

Version-Release number of selected component:
selinux-policy-3.13.1-164.fc24.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.4.0-0.rc6.git1.1.fc24.x86_64
type:           libreport

Comment 4 Adam Williamson 2016-01-05 01:04:26 UTC
Description of problem:
I believe this happened at startup of a recently updated Rawhide system.


Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.4.0-0.rc6.git1.2.fc24.x86_64
type:           libreport

Comment 5 Adam Williamson 2016-01-12 23:58:51 UTC
Description of problem:
This happens when trying to start the new virtlogd.socket from libvirt, which is required for virtlogd.service , which is required (per RHBZ #1290357) in order to start virtual machines, now.


Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.4.0-1.fc24.x86_64
type:           libreport

Comment 6 Adam Williamson 2016-01-13 00:26:16 UTC
Proposing as a Final blocker, criterion "All system services present after installation with one of the release-blocking package sets must start properly, unless they require hardware which is not present." - https://fedoraproject.org/wiki/Fedora_24_Final_Release_Criteria#System_services . This bug results in virtlogd.service failing to start after install of Workstation, per openQA tests, e.g. https://openqa.stg.fedoraproject.org/tests/4307 .

Comment 7 Stephen Gallagher 2016-01-14 14:13:30 UTC
Description of problem:
I attempted to create a new virtual machine using virt-manager. It failed with the error:

Unable to complete install: 'Failed to connect socket to '/var/run/libvirt/virtlogd-sock': No such file or directory'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 90, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 2277, in _do_async_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 501, in start_install
    noboot)
  File "/usr/share/virt-manager/virtinst/guest.py", line 416, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3595, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: Failed to connect socket to '/var/run/libvirt/virtlogd-sock': No such file or directory

When I went and attempted to start virtlogd.socket manually with systemctl, I got the error:

Jan 14 09:10:28 sgallagh540.sgallagh.rht systemd[1]: virtlogd.socket: Failed to listen on sockets: Permission denied
Jan 14 09:10:28 sgallagh540.sgallagh.rht systemd[1]: Failed to listen on Virtual machine log manager socket.

Examining the SELinux errors, it seems that this denial is to blame.

Version-Release number of selected component:
selinux-policy-3.13.1-165.fc24.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.4.0-1.fc24.x86_64
type:           libreport

Comment 8 Petr Schindler 2016-01-18 17:48:24 UTC
Discussed at 2016-01-18 blocker review meeting: [1]. 

This bug was accepted as a Final blocker: This bug violates the final criterion "All system services present after installation with one of the release-blocking package sets must start properly, unless they require hardware which is not present."

[1] http://meetbot.fedoraproject.org/fedora-blocker-review/2016-01-18/f24-blocker-review.2016-01-18-17.02.html

Comment 9 Lukas Vrabec 2016-01-19 14:04:43 UTC
*** Bug 1299805 has been marked as a duplicate of this bug. ***

Comment 10 Lukas Vrabec 2016-01-19 14:12:48 UTC
Hi, 

Could anyone test this issue with this reproducer:

1. #semanage fcontext -a -t virtd_exec_t /usr/sbin/virtlogd
2. #restorecon -v /usr/sbin/virtlogd
3. reboot system

It looks like this working on my Rawhide system. 

Thank you!

Comment 11 Joachim Frieben 2016-01-19 20:43:33 UTC
(In reply to Lukas Vrabec from comment #10)
The suggested action enables virtlogd to start up correctly, thanks!

Comment 12 Jason Taylor 2016-01-20 01:24:16 UTC
Description of problem:
Launched virt-manager from GNOME desktop session.

Version-Release number of selected component:
selinux-policy-3.13.1-167.fc24.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.3.3-300.fc23.x86_64
type:           libreport

Comment 13 Elvir Kuric 2016-01-20 08:46:12 UTC
(In reply to Lukas Vrabec from comment #10)
> Hi, 
> 
> Could anyone test this issue with this reproducer:
> 
> 1. #semanage fcontext -a -t virtd_exec_t /usr/sbin/virtlogd
> 2. #restorecon -v /usr/sbin/virtlogd
> 3. reboot system
> 
> It looks like this working on my Rawhide system. 
> 
> Thank you!

yes, this works on Rawhide. Tested

Comment 14 Lukas Vrabec 2016-01-20 09:10:35 UTC
commit 18f7e12057c5a676209736396b95ece0fdae9faf
Author: Lukas Vrabec <lvrabec@redhat.com>
Date:   Wed Jan 20 10:09:40 2016 +0100

    Label virtlogd binary as virtd_exec_t. BZ(1291940)

Comment 15 Lukas Vrabec 2016-01-20 09:15:15 UTC
*** Bug 1296309 has been marked as a duplicate of this bug. ***

Comment 16 Lukas Vrabec 2016-01-20 14:50:01 UTC
*** Bug 1293722 has been marked as a duplicate of this bug. ***

Comment 17 Jan Kurik 2016-02-24 15:46:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 18 Fedora Update System 2016-03-11 09:56:22 UTC
selinux-policy-3.13.1-178.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-1350c96015

Comment 19 Fedora Update System 2016-03-11 19:26:01 UTC
selinux-policy-3.13.1-178.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-1350c96015

Comment 20 Fedora Update System 2016-03-16 13:42:28 UTC
selinux-policy-3.13.1-179.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-8f142bb969

Comment 21 Fedora Update System 2016-03-18 14:58:53 UTC
selinux-policy-3.13.1-179.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-8f142bb969

Comment 22 Fedora Update System 2016-03-23 16:54:58 UTC
selinux-policy-3.13.1-179.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 23 Anass Ahmed 2016-09-04 14:37:32 UTC
Description of problem:
Always happens after any upgrade (using DNF), SELinux Violation by Systemd.


Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.6.7-300.fc24.x86_64
type:           libreport

Comment 24 Anass Ahmed 2016-09-04 14:38:56 UTC
This just started to happen recently (3 days ago max.)

Comment 25 Stephen Gallagher 2017-02-06 13:15:19 UTC
I'm reopening this, as it's happening to me on a fully-updated Rawhide system right now (selinux-policy-3.13.1-236.fc26.noarch) and attempting to report it via the SELinux Troubleshooter keeps marking it as duplicate of this issue.

Comment 26 Amnon Harel 2017-03-06 13:02:53 UTC
Same selinux report on RH25, with Policy RPM:
selinux-policy-3.13.1-224.fc25.noarch 
selinux-policy-3.13.1-225.6.fc25.noarch

Comment 27 Fedora End Of Life 2017-07-25 19:38:42 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 28 Fedora End Of Life 2017-08-08 12:31:50 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 29 Adam Williamson 2017-08-11 01:06:25 UTC
Re-opening per #c25; it may not *really* be the same bug, but still.

Comment 30 Айфф 2017-09-05 15:26:10 UTC
Description of problem:
I turn on the computer.

Version-Release number of selected component:
selinux-policy-3.13.1-224.fc25.noarch

Additional info:
reporter:       libreport-2.9.1
hashmarkername: setroubleshoot
kernel:         4.12.9-300.fc26.x86_64
type:           libreport

Comment 31 poikilos 2017-10-29 02:51:34 UTC
Description of problem:
After upgrading from Fedora 25 to 26, this AVC denial message appears. Clicking the details shows that systemd is being blocked from create, read, and unlink. This happens at every login, even after full update of all packges via dnf update.

Version-Release number of selected component:
selinux-policy-3.13.1-224.fc25.noarch

Additional info:
reporter:       libreport-2.9.1
hashmarkername: setroubleshoot
kernel:         4.13.9-200.fc26.x86_64
type:           libreport

Comment 32 Fedora End Of Life 2018-05-03 08:10:14 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 33 Fedora End Of Life 2018-05-29 11:53:05 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 34 user 2018-06-16 22:50:12 UTC
Sorry I'm really new here (first comment actually), I didn't figure out how to reopen this. 

This is still happening on Fedora 28.

^C[root@localhost user]# audit2allow -a


#============= systemd_logind_t ==============
allow systemd_logind_t virtlogd_t:dbus send_msg;

#============= virtlogd_t ==============
allow virtlogd_t systemd_logind_t:dbus send_msg;
allow virtlogd_t virt_etc_rw_t:dir search;

audit2allow -a -M libvirt_fixes

To make this policy package active, execute:

semodule -i libvirt_fixes.pp

[root@localhost user]# semodule -i libvirt_fixes.pp

Are the permissions required to be allowed to run it properly.

Comment 35 user 2018-06-16 22:52:00 UTC
Created attachment 1452286 [details]
libvirt selinux bugfix module


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