Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
"SELinux is preventing chronyc from 'read, write' accesses on the chr_file /dev/tty1"
Running "chronyc sources" or "chronyc tracking" on the console of the VM does not yield results. Outputs shown as expected on running commands after ssh-ing in.
Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-192.el7_5.3.noarch
chrony-3.2-2.el7.x86_64
How reproducible:
Always
Steps to Reproduce:
1. Build VM
2. Access the console
3. Run "chronyc" commands
Actual results:
None
Expected results:
# chronyc sources
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^+ mika.470n.act.tsgnl.co 2 9 377 330 -1439us[-1439us] +/- 73ms
^* mice.spiderspace.co.uk 2 10 377 653 +2097us[+6988us] +/- 22ms
^+ ntp1.ds.network 2 10 377 629 -476us[ -476us] +/- 34ms
^- y.ns.gin.ntt.net 2 9 377 373 +8883us[+8883us] +/- 135ms
Additional info:
Disabling the don't audit rules:
~~~
# semodule -DB
# sealert -l f5658a65-4e95-4a14-a831-7c70fe4ee471
SELinux is preventing chronyc from 'read, write' accesses on the chr_file /dev/tty1.
***** Plugin catchall_boolean (89.3 confidence) suggests ******************
If you want to allow all daemons the ability to read/write terminals
Then you must tell SELinux about this by enabling the 'daemons_use_tty' boolean.
Do
setsebool -P daemons_use_tty 1
***** Plugin catchall (11.6 confidence) suggests **************************
If you believe that chronyc should be allowed read write access on the tty1 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 'chronyc' --raw | audit2allow -M my-chronyc
# semodule -i my-chronyc.pp
Additional Information:
Source Context unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023
Target Context unconfined_u:object_r:user_tty_device_t:s0
Target Objects /dev/tty1 [ chr_file ]
Source chronyc
Source Path chronyc
Port <Unknown>
Host server.dns.com
Source RPM Packages chrony-3.2-2.el7.x86_64
Target RPM Packages
Policy RPM selinux-policy-3.13.1-192.el7_5.3.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Enforcing
Host Name server.com
Platform Linux server.dns.com 3.10.0-862.el7.x86_64 #1 SMP
Wed Mar 21 18:14:51 EDT 2018 x86_64 x86_64
Alert Count 2
First Seen 2018-05-11 14:43:04 AEST
Last Seen 2018-05-11 16:14:30 AEST
Local ID f5658a65-4e95-4a14-a831-7c70fe4ee471
Raw Audit Messages
type=AVC msg=audit(1526019270.702:390): avc: denied { read write } for pid=16036 comm="chronyc" path="/dev/tty1" dev="devtmpfs" ino=1043 scontext=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tty_device_t:s0 tclass=chr_file
~~~
Description of problem: "SELinux is preventing chronyc from 'read, write' accesses on the chr_file /dev/tty1" Running "chronyc sources" or "chronyc tracking" on the console of the VM does not yield results. Outputs shown as expected on running commands after ssh-ing in. Version-Release number of selected component (if applicable): selinux-policy-3.13.1-192.el7_5.3.noarch chrony-3.2-2.el7.x86_64 How reproducible: Always Steps to Reproduce: 1. Build VM 2. Access the console 3. Run "chronyc" commands Actual results: None Expected results: # chronyc sources 210 Number of sources = 4 MS Name/IP address Stratum Poll Reach LastRx Last sample =============================================================================== ^+ mika.470n.act.tsgnl.co 2 9 377 330 -1439us[-1439us] +/- 73ms ^* mice.spiderspace.co.uk 2 10 377 653 +2097us[+6988us] +/- 22ms ^+ ntp1.ds.network 2 10 377 629 -476us[ -476us] +/- 34ms ^- y.ns.gin.ntt.net 2 9 377 373 +8883us[+8883us] +/- 135ms Additional info: Disabling the don't audit rules: ~~~ # semodule -DB # sealert -l f5658a65-4e95-4a14-a831-7c70fe4ee471 SELinux is preventing chronyc from 'read, write' accesses on the chr_file /dev/tty1. ***** Plugin catchall_boolean (89.3 confidence) suggests ****************** If you want to allow all daemons the ability to read/write terminals Then you must tell SELinux about this by enabling the 'daemons_use_tty' boolean. Do setsebool -P daemons_use_tty 1 ***** Plugin catchall (11.6 confidence) suggests ************************** If you believe that chronyc should be allowed read write access on the tty1 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 'chronyc' --raw | audit2allow -M my-chronyc # semodule -i my-chronyc.pp Additional Information: Source Context unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 Target Context unconfined_u:object_r:user_tty_device_t:s0 Target Objects /dev/tty1 [ chr_file ] Source chronyc Source Path chronyc Port <Unknown> Host server.dns.com Source RPM Packages chrony-3.2-2.el7.x86_64 Target RPM Packages Policy RPM selinux-policy-3.13.1-192.el7_5.3.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name server.com Platform Linux server.dns.com 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018 x86_64 x86_64 Alert Count 2 First Seen 2018-05-11 14:43:04 AEST Last Seen 2018-05-11 16:14:30 AEST Local ID f5658a65-4e95-4a14-a831-7c70fe4ee471 Raw Audit Messages type=AVC msg=audit(1526019270.702:390): avc: denied { read write } for pid=16036 comm="chronyc" path="/dev/tty1" dev="devtmpfs" ino=1043 scontext=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tty_device_t:s0 tclass=chr_file ~~~