Bug 1528526 - SELinux is preventing systemd from listen access on the tcp_socket
Summary: SELinux is preventing systemd from listen access on the tcp_socket
Keywords:
Status: CLOSED DUPLICATE of bug 1366968
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 27
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-22 03:10 UTC by Todd
Modified: 2018-01-05 13:53 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-05 13:53:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Todd 2017-12-22 03:10:48 UTC
I am trying to run
      # systemctl start saned.socket

And SELinux is taking a shine to it.  I have run

# ausearch -c 'systemd' --raw | audit2allow -M my-systemd
# semodule -X 300 -i my-systemd.pp


four times and the same SELinux error keeps appearing:

The folks over on 
https://ask.fedoraproject.org/en/question/115386/need-selinux-and-saned-help/?answer=115387#post-id-115387
suggested I report this to you


saned.socket

[Unit]
Description=saned incoming socket

[Socket]
ListenStream=6566
Accept=yes
MaxConnections=1

[Install]
WantedBy=sockets.target


saned

[Unit]
Description=Scanner Service
Requires=saned.socket

[Service]
ExecStart=/usr/sbin/saned
User=saned
Group=saned
StandardInput=socket
StandardOutput=syslog
StandardError=syslog
# Environment=SANE_CONFIG_DIR=/etc/sane.d 
Environment=SANE_CONFIG_DIR=/etc/sane.d SANE_DEBUG_DLL=255 SANE_DEBUG_BJNP=5 SANE_DEBUG_NET=128


[Install]
Also=saned.socket



SELinux is preventing systemd from listen access on the tcp_socket port None.

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

If you believe that systemd should be allowed listen access on the port None tcp_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:
# ausearch -c 'systemd' --raw | audit2allow -M my-systemd
# semodule -X 300 -i my-systemd.pp

Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:system_r:unconfined_service_t:s0
Target Objects                port None [ tcp_socket ]
Source                        systemd
Source Path                   systemd
Port                          <Unknown>
Host                          rn4.xxx.local
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-283.18.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     rn4.xxx.local
Platform                      Linux rn4.xxx.local 4.14.7-300.fc27.x86_64
                              #1 SMP Mon Dec 18 16:06:12 UTC 2017 x86_64 x86_64
Alert Count                   5
First Seen                    2017-12-20 13:35:43 PST
Last Seen                     2017-12-20 13:35:46 PST
Local ID                      0e806a1d-c379-4c0e-993b-286c5828ef2b

Raw Audit Messages
type=AVC msg=audit(1513805746.614:968): avc:  denied  { listen } for  pid=1 comm="systemd" lport=6566 scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=tcp_socket permissive=0


Hash: systemd,init_t,unconfined_service_t,tcp_socket,listen

Comment 1 Todd 2017-12-23 07:56:46 UTC
This FC24 closed bug may be of interest:
https://bugzilla.redhat.com/show_bug.cgi?id=1372754

Comment 2 Lukas Vrabec 2018-01-05 13:53:02 UTC

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


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