Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1485363 - Unable to start a getty on ttyUSB0 with SELinux enabled
Summary: Unable to start a getty on ttyUSB0 with SELinux enabled
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-25 13:29 UTC by Ondřej Lysoněk
Modified: 2017-12-12 10:12 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-12 10:12:44 UTC
Type: Bug


Attachments (Terms of Use)
audit.log (578.51 KB, text/plain)
2017-08-25 13:29 UTC, Ondřej Lysoněk
no flags Details

Description Ondřej Lysoněk 2017-08-25 13:29:13 UTC
Created attachment 1318211 [details]
audit.log

Description of problem:
SELinux is preventing getty from starting on /dev/ttyUSB0 (a USB-serial converter, context system_u:object_r:usbtty_device_t:s0).

Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-225.19.fc25.noarch

How reproducible:
always

Steps to Reproduce:
1. Plug in a USB-serial converter
2. systemctl start serial-getty@ttyUSB0.service
3. See the audit log and output of 'systemctl status serial-getty@ttyUSB0.service'

Actual results:
agetty, systemd, login and unix_chkpwd are denied access to the tty.

Expected results:
The getty should work.

Additional info:
It seems to work with the following policy, generated by audit2allow, applied:

module local 1.0;

require {
	type getty_t;
	type local_login_t;
	type usbtty_device_t;
	type init_t;
	class chr_file { getattr ioctl open read relabelfrom relabelto setattr write };
}

#============= getty_t ==============
allow getty_t usbtty_device_t:chr_file { getattr ioctl open read write };

#============= init_t ==============
allow init_t usbtty_device_t:chr_file { ioctl open read write };

#============= local_login_t ==============
allow local_login_t usbtty_device_t:chr_file { getattr ioctl open read relabelfrom relabelto setattr write };


Note that it doesn't contain any rules for unix_chkpwd - after the above policy is applied, I still get the AVCs related to unix_chkpwd in the logs, but the getty seems to work and I'm able to log in. I don't know why. The policy might be incomplete anyway though. I think the policy should be the same as for other tty devices, such as /dev/tty1.

I'm attaching the full audit log since attempting to start the getty for the first time. grep for usbtty to get the relevant lines.

Comment 1 Fedora End Of Life 2017-11-16 19:21:43 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 2 Fedora End Of Life 2017-12-12 10:12:44 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 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.