Bug 1399758 - SELinux is preventing systemd from 'create' accesses on the tcp_socket port None.
Summary: SELinux is preventing systemd from 'create' accesses on the tcp_socket port N...
Keywords:
Status: CLOSED DUPLICATE of bug 1366968
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:f680596475fced633dedd2c4c47...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-29 16:40 UTC by Matěj Cepl
Modified: 2018-04-11 07:33 UTC (History)
14 users (show)

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


Attachments (Terms of Use)

Description Matěj Cepl 2016-11-29 16:40:22 UTC
Description of problem:
SELinux is preventing systemd from 'create' accesses on the tcp_socket port None.

This is trying to start leafnode.socket systemd service on Fedora 25.

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

If you believe that systemd should be allowed create 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                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-224.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.8.10-300.fc25.x86_64 #1 SMP Mon
                              Nov 21 18:59:16 UTC 2016 x86_64 x86_64
Alert Count                   12
First Seen                    2016-11-27 00:20:28 CET
Last Seen                     2016-11-29 17:37:03 CET
Local ID                      8b394ab9-3a43-42d4-92ef-b91a6c94995b

Raw Audit Messages
type=AVC msg=audit(1480437423.975:644): 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=tcp_socket permissive=0


Hash: systemd,init_t,unconfined_service_t,tcp_socket,create

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

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.10-300.fc25.x86_64
type:           libreport

Potential duplicate: bug 1372754

Comment 1 Matěj Cepl 2016-11-29 16:54:09 UTC
In the end I had to create this policy module:

mitmanek:~# cat leafnode.te 

module leafnode 1.2;

require {
	type init_t;
	type unconfined_service_t;
	class tcp_socket { accept bind create getattr listen setopt };
}

#============= init_t ==============
allow init_t unconfined_service_t:tcp_socket { accept getattr };
allow init_t unconfined_service_t:tcp_socket { bind create listen setopt };
mitmanek:~#

Comment 2 Brian J. Murrell 2016-11-30 06:30:33 UTC
Description of problem:
Happened during upgrade to F25

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

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.8-300.fc25.x86_64
type:           libreport

Comment 3 Kazuo Moriwaka 2017-01-23 10:28:08 UTC
Description of problem:
I was trying to start tangd.socket 

reproducer:
1. dnf install tang
2. make keys
# sudo jose gen -t '{"alg":"ES256"}' -o /var/db/tang/sig.jwk

# sudo jose gen -t '{"kty":"EC","crv":"P-256","key_ops":["deriveKey"]}' \
  -o /var/db/tang/exc.jwk
3. start services
# sudo systemctl enable tangd-update.path
# sudo systemctl start tangd-update.path
# sudo systemctl enable tangd.socket
# sudo systemctl start tangd.socket

it causes fail of starting socket and selinux alert.

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

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.9.3-200.fc25.x86_64
type:           libreport

Comment 4 Nathaniel McCallum 2017-11-02 19:24:39 UTC
(In reply to Kazuo Moriwaka from comment #3)
> Description of problem:
> I was trying to start tangd.socket 
> 
> reproducer:
> 1. dnf install tang
> 2. make keys
> # sudo jose gen -t '{"alg":"ES256"}' -o /var/db/tang/sig.jwk
> 
> # sudo jose gen -t '{"kty":"EC","crv":"P-256","key_ops":["deriveKey"]}' \
>   -o /var/db/tang/exc.jwk
> 3. start services
> # sudo systemctl enable tangd-update.path
> # sudo systemctl start tangd-update.path
> # sudo systemctl enable tangd.socket
> # sudo systemctl start tangd.socket
> 
> it causes fail of starting socket and selinux alert.
> 
> Version-Release number of selected component:
> selinux-policy-3.13.1-225.6.fc25.noarch
> 
> Additional info:
> reporter:       libreport-2.8.0
> hashmarkername: setroubleshoot
> kernel:         4.9.3-200.fc25.x86_64
> type:           libreport


Just FYI, enabling tang requires just:
1. dnf install tang
2. systemctl enable --now tangd.socket

Don't bother with all those extra commands.

Comment 5 Fedora End Of Life 2017-11-16 18:34:46 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. 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 '25'.

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 25 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 6 Jan Pazdziora 2017-12-26 09:05:22 UTC
For the record, I just hit something very similar (same?) on Fedora 27 when attempting the two-step process from comment 4: bug 1529068.

Comment 7 Lukas Vrabec 2018-01-05 13:52:39 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.