Bug 1404296 - SELinux is preventing systemd from create access on the unix_stream_socket Unknown.
Summary: SELinux is preventing systemd from create access on the unix_stream_socket Un...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-13 14:52 UTC by Ian Pilcher
Modified: 2019-05-28 20:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-28 20:14:10 UTC
Type: Bug


Attachments (Terms of Use)

Description Ian Pilcher 2016-12-13 14:52:38 UTC
After upgrading from F23 to F25, SELinux is preventing systemd from creating a TCP socket.

  [Unit]
  Description=Socket for Xvnc display :10

  [Socket]
  ListenStream=172.31.250.1:5910
  Accept=true
  MaxConnections=1
  KeepAlive=true
  FreeBind=true

  [Install]
  WantedBy=sockets.target

type=AVC msg=audit(1481640616.368:1596): avc:  denied  { create } for  pid=1 comm="systemd" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:xserver_t:s0 tclass=tcp_socket permissive=0

I have already updated to selinux-policy-targeted-3.13.1-225.3.fc25.noarch.

Comment 1 Simon Sekidde 2016-12-15 18:12:18 UTC
We have 

 allow init_t daemon : tcp_socket { ioctl read write create getattr setattr lock append bind connect listen accept getopt setopt shutdown } ; 

So xserver_t should get marked as an init_daemon_domain() instead

Comment 2 Ian Pilcher 2017-10-01 14:51:10 UTC
Still present in Fedora 26 (selinux-policy-targeted-3.13.1-260.9.fc26.noarch)

Comment 3 Ian Pilcher 2017-10-01 23:52:55 UTC
For posterity (i.e. the next time I do a clean install), the workaround is:

allow init_t xserver_t:tcp_socket { accept bind create getattr ioctl listen setopt };

Comment 4 Fedora End Of Life 2018-05-03 08:14:51 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 5 Ian Pilcher 2018-05-03 13:36:19 UTC
Issue still present in Fedora 28.

Comment 6 Ian Pilcher 2018-05-14 14:26:32 UTC
systemd socket behavior seems to have changed slightly in F28, so that it also needs "read write" permission.

policy_module(rhbz1404296, 0.0.2)

require {
        type xserver_t;
        type init_t;
};

allow init_t xserver_t:tcp_socket { accept bind create getattr ioctl listen setopt read write };

Comment 7 Ben Cotton 2019-05-02 21:47:15 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. 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 '28'.

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 28 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 8 Ben Cotton 2019-05-28 20:14:10 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 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.


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