Bug 1420522

Summary: cups-lpd.socket won't start with SELinux enforcing
Product: [Fedora] Fedora Reporter: Bryan Mason <bmason>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 26CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba, pmoore, ssekidde
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-29 12:33:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
output of sealert -l '*' none

Description Bryan Mason 2017-02-08 21:26:15 UTC
Description of problem:

  Can't start cups-lpd.socket when SELinux is in enforcing mode.

Version-Release number of selected component (if applicable):

  cups-lpd-2.1.4-3.fc24.x86_64
  selinux-policy-3.13.1-191.24.fc24.noarch

How reproducible:

  100%

Steps to Reproduce:

 1. systemctl start cups-lpd.socket

Actual results:

  Job for cups-lpd.socket failed. See "systemctl status cups-lpd.socket" 
  and "journalctl -xe" for details.

Expected results:

  The service should start.

Additional info:

# systemctl status cups-lpd.socket
● cups-lpd.socket - CUPS LPD Server Socket
   Loaded: loaded (/usr/lib/systemd/system/cups-lpd.socket; enabled; vendor preset: disabled)
   Active: failed (Result: resources) since Wed 2017-02-08 13:19:41 PST; 3min 2s ago
   Listen: [::]:515 (Stream)
 Accepted: 2; Connected: 0

journalctl -xe includes:

Feb 08 13:22:10 <redacted>.redhat.com setroubleshoot[31173]: SELinux is preventing systemd from create access on the tcp_socket port None. For complete SELinux messages. run sealert -l f2551642-e4bb-41c0-851e-ea0f2efd869c

# sealert -l f2551642-e4bb-41c0-851e-ea0f2efd869c

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

*****  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:cupsd_lpd_t:s0
Target Objects                port None [ tcp_socket ]
Source                        systemd
Source Path                   systemd
Port                          <Unknown>
Host                          <redacted>.redhat.com
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.24.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     <redacted>.redhat.com
Platform                      Linux <redacted>.redhat.com
                              4.9.5-100.fc24.x86_64 #1 SMP Fri Jan 20 12:27:44
                              UTC 2017 x86_64 x86_64
Alert Count                   6
First Seen                    2017-02-08 12:38:37 PST
Last Seen                     2017-02-08 13:22:06 PST
Local ID                      f2551642-e4bb-41c0-851e-ea0f2efd869c

Raw Audit Messages
type=AVC msg=audit(1486588926.842:2985): avc:  denied  { create } for  pid=1 comm="systemd" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:cupsd_lpd_t:s0 tclass=tcp_socket permissive=0

Hash: systemd,init_t,cupsd_lpd_t,tcp_socket,create

Comment 1 Bryan Mason 2017-02-08 21:27:19 UTC
This may be related to Bug 1399758, Bug 1372754, Bug 1361124, or Bug 1291940

Comment 2 Fedora End Of Life 2017-07-26 00:15:22 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 3 Fedora End Of Life 2017-08-08 19:38:45 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 4 Bryan Mason 2017-10-26 17:22:46 UTC
Created attachment 1343878 [details]
output of sealert -l '*'

Still a problem in F26:

    # systemctl start cups-lpd.socket
    Job for cups-lpd.socket failed.

# systemctl status cups-lpd.socket
● cups-lpd.socket - CUPS LPD Server Socket
   Loaded: loaded (/usr/lib/systemd/system/cups-lpd.socket; disabled; vendor preset: disabled)
   Active: failed (Result: resources)
   Listen: [::]:515 (Stream)
 Accepted: 0; Connected: 0

Running "sealert -l '*'" results in the attached log file.

Comment 5 Fedora End Of Life 2018-05-03 08:15:20 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 6 Fedora End Of Life 2018-05-29 12:33:48 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.