Bug 1663620 - SELinux is preventing systemd-getty-g from read, write access on the chr_file ttyUSB0.
Summary: SELinux is preventing systemd-getty-g from read, write access on the chr_file...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 29
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:c4aa000f9f35d860e469721cce8...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-05 15:34 UTC by Brian J. Murrell
Modified: 2019-04-08 01:53 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.14.2-53.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-08 01:53:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Brian J. Murrell 2019-01-05 15:34:09 UTC
Description of problem:
Using a USB->serial console
SELinux is preventing systemd-getty-g from read, write access on the chr_file ttyUSB0.

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

If you believe that systemd-getty-g should be allowed read write access on the ttyUSB0 chr_file 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-getty-g' --raw | audit2allow -M my-systemdgettyg
# semodule -X 300 -i my-systemdgettyg.pp

Additional Information:
Source Context                system_u:system_r:init_t:s0
Target Context                system_u:object_r:usbtty_device_t:s0
Target Objects                ttyUSB0 [ chr_file ]
Source                        systemd-getty-g
Source Path                   systemd-getty-g
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.2-42.fc29.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.18.16-300.fc29.x86_64 #1 SMP Sat
                              Oct 20 23:24:08 UTC 2018 x86_64 x86_64
Alert Count                   26
First Seen                    2018-11-01 13:54:07 EDT
Last Seen                     2018-12-02 17:42:02 EST
Local ID                      9fa5ce61-6e63-42e5-9a0d-7b10d1c1cdc0

Raw Audit Messages
type=AVC msg=audit(1543790522.268:8177): avc:  denied  { read write } for  pid=24046 comm="systemd-getty-g" name="ttyUSB0" dev="devtmpfs" ino=19115 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:usbtty_device_t:s0 tclass=chr_file permissive=0


Hash: systemd-getty-g,init_t,usbtty_device_t,chr_file,read,write

Version-Release number of selected component:
selinux-policy-3.14.2-42.fc29.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.7
hashmarkername: setroubleshoot
kernel:         4.19.13-300.fc29.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2019-01-17 15:11:57 UTC
Opened a pull request granting granting the missing permission:

https://github.com/fedora-selinux/selinux-policy/pull/239

Comment 2 Lukas Vrabec 2019-01-25 12:47:03 UTC
Merged. 

commit db4a060a02e6caa5bbf89f8f08d521831b80f771 (HEAD -> rawhide, origin/rawhide)
Author: Zdenek Pytela <zpytela>
Date:   Fri Jan 11 16:58:54 2019 +0100

    Allow init_t domain access to USB ttys BZ(1663620)
    
    Character device files for USB terminals have a particular usbtty_device_t type.
    When a USB device is used as a serial console, systemd-getty-generator
    running in init_t domain needs to have access to it, similar to terminals
    with a different type.
    
    Fedoras 29 and 28 are affected.
    
    Signed-off-by: Zdenek Pytela <zpytela>

Comment 3 Fedora Update System 2019-04-05 17:27:57 UTC
selinux-policy-3.14.2-53.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-bf377d92c7

Comment 4 Fedora Update System 2019-04-06 20:51:14 UTC
selinux-policy-3.14.2-53.fc29 has been pushed to the Fedora 29 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-2019-bf377d92c7

Comment 5 Fedora Update System 2019-04-08 01:53:01 UTC
selinux-policy-3.14.2-53.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


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