Bug 1307443 - Selinux is preventing agetty from access to ttyUSB0
Selinux is preventing agetty from access to ttyUSB0
Status: NEW
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
25
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-13 16:15 EST by Jonas Jonsson
Modified: 2017-04-22 01:09 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonas Jonsson 2016-02-13 16:15:32 EST
Description of problem:
Trying to run serial console via ttyUSB0
/proc/cmdline contains console=tty0 console=ttyUSB0,115200n8 but I don't get a login prompt on the serial console.

If I manually start agetty with "agetty ttyUSB0 115200 vt220" it works, but not when started by systemd with "systemctl start serial-getty@ttyUSB0.service"

journal shows
feb 13 22:12:54 bender audit[22963]: AVC avc:  denied  { read write } for  pid=22963 comm="agetty" name="ttyUSB0" dev="devtmpfs" ino=15513 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usbtty_device_t:s0 tclass=chr_file permissive=0

Using setenforce 0 make it all work.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.13.1-158.4.fc23.noarch

How reproducible:
Always.

Steps to Reproduce:
1. systemctl start serial-getty@ttyUSB0.service

Actual results:
AVC denial and non-working serial console.

Expected results:
Working console, i.e. login prompt.

Additional info:
It seems to be similar to bug #870659.
Comment 1 Fedora End Of Life 2016-11-24 10:33:44 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. 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 '23'.

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 23 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 Jonas Jonsson 2016-12-04 14:39:14 EST
Same problem in Fedora 25.

dec 04 20:38:37 bender audit[1]: AVC avc:  denied  { read write } for  pid=1 comm="systemd" name="ttyUSB0" dev="devtmpfs" ino=2626 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:usbtty_device_t:s0 tclass=chr_file permissive=0
dec 04 20:38:37 bender audit[1]: AVC avc:  denied  { read write } for  pid=1 comm="systemd" name="ttyUSB0" dev="devtmpfs" ino=2626 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:usbtty_device_t:s0 tclass=chr_file permissive=0
dec 04 20:38:37 bender audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=serial-getty@ttyUSB0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
dec 04 20:38:37 bender systemd[1]: serial-getty@ttyUSB0.service: Service hold-off time over, scheduling restart.
dec 04 20:38:37 bender audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=serial-getty@ttyUSB0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
dec 04 20:38:37 bender audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=serial-getty@ttyUSB0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
dec 04 20:38:37 bender systemd[1]: Stopped Serial Getty on ttyUSB0.
dec 04 20:38:37 bender audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=serial-getty@ttyUSB0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
dec 04 20:38:37 bender systemd[1]: Started Serial Getty on ttyUSB0.
dec 04 20:38:37 bender audit[5788]: AVC avc:  denied  { read write } for  pid=5788 comm="(agetty)" name="ttyUSB0" dev="devtmpfs" ino=2626 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:usbtty_device_t:s0 tclass=chr_file permissive=0
dec 04 20:38:37 bender audit[5788]: AVC avc:  denied  { read write } for  pid=5788 comm="(agetty)" name="ttyUSB0" dev="devtmpfs" ino=2626 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:usbtty_device_t:s0 tclass=chr_file permissive=0
dec 04 20:38:37 bender audit[5788]: AVC avc:  denied  { open } for  pid=5788 comm="agetty" path="/dev/ttyUSB0" dev="devtmpfs" ino=2626 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usbtty_device_t:s0 tclass=chr_file permissive=0

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