Bug 1575002 - chrony commands does not print output to tty on console
Summary: chrony commands does not print output to tty on console
Keywords:
Status: CLOSED DUPLICATE of bug 1574418
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.5
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-04 14:00 UTC by Ravindra Patil
Modified: 2018-11-06 08:21 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-18 16:46:04 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Ravindra Patil 2018-05-04 14:00:32 UTC
Description of problem:
When we run chrony related commands on console, no output is shown on terminal byt when same output redirected to file, it gets written to file but nothing is printed on tty (terminal). 

Version-Release number of selected component (if applicable):
chrony-3.2-2.el7.x86_64

How reproducible:
Install RHEL7.5 or upgrade to RHEL7.5 and run crony related commands from the console
# chronyc tracking
# chronyc sources

Steps to Reproduce:
1. Install or upgrade to RHEL 7.5
2. Login to the console
3. Run chrony related commands

Actual results:
No output shown on the terminal (console)

Expected results:
Output should be printed on the terminal 

Additional info:

This only happens when logged in through console. If you ssh to the system and run the chrony commands, output is shown on the ssh terminal. 

From console, if output is redirected to file instead of terminal, then chrony command output is written to the file.

Comment 2 Miroslav Lichvar 2018-05-04 14:12:03 UTC
This seems to be a selinux issue, possibly a duplicate of bug #1574418.

As a workaround, piping the output through cat works.

Comment 3 Ravindra Patil 2018-05-04 14:20:32 UTC
The issue reported above is about tty, redirecting to file works fine. 

The output is not printed on the tty (terminal) when executed chrony related commands on the console. The output is blank

From console
# chronyc tracking
# chronyc sources
# 
No output printed on the terminal, commands execute but nothing is printed.

If on same console terminal, I redirect output to file, it is written to file fine. 

# chronyc tracking > /tmp/chrony_tracking
# cat /tmp/chrony_tracking
Reference ID    : 344205B9 (ec2-52-66-5-185.ap-south-1.compute.amazonaws.com)
Stratum         : 3
Ref time (UTC)  : Fri May 04 14:08:41 2018
System time     : 0.000000074 seconds fast of NTP time
Last offset     : -0.000610918 seconds
RMS offset      : 0.003948574 seconds
Frequency       : 17.642 ppm fast
Residual freq   : -0.101 ppm
Skew            : 1.669 ppm
Root delay      : 0.092673689 seconds
Root dispersion : 0.026519082 seconds
Update interval : 64.6 seconds
Leap status     : Normal

Comment 4 Milos Malik 2018-05-11 07:31:51 UTC
Seen in enforcing mode after removing the dontaudit rules:
----
type=PROCTITLE msg=audit(05/11/2018 03:26:48.683:69) : proctitle=chronyc sources 
type=SYSCALL msg=audit(05/11/2018 03:26:48.683:69) : arch=ppc64le syscall=execve success=yes exit=0 a0=0x1002e679cd0 a1=0x1002e684170 a2=0x1002e685c60 a3=0x21 items=0 ppid=9474 pid=9507 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=1 comm=chronyc exe=/usr/bin/chronyc subj=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 key=(null) 
type=AVC msg=audit(05/11/2018 03:26:48.683:69) : avc:  denied  { read write } for  pid=9507 comm=chronyc path=/dev/hvc0 dev="devtmpfs" ino=10242 scontext=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tty_device_t:s0 tclass=chr_file 
type=AVC msg=audit(05/11/2018 03:26:48.683:69) : avc:  denied  { read write } for  pid=9507 comm=chronyc path=/dev/hvc0 dev="devtmpfs" ino=10242 scontext=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tty_device_t:s0 tclass=chr_file 
type=AVC msg=audit(05/11/2018 03:26:48.683:69) : avc:  denied  { read write } for  pid=9507 comm=chronyc path=/dev/hvc0 dev="devtmpfs" ino=10242 scontext=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tty_device_t:s0 tclass=chr_file 
type=AVC msg=audit(05/11/2018 03:26:48.683:69) : avc:  denied  { read write } for  pid=9507 comm=chronyc path=/dev/hvc0 dev="devtmpfs" ino=10242 scontext=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tty_device_t:s0 tclass=chr_file 
----

The audit2allow tool recommends to use 'daemons_use_tty' boolean, but chronyc is not a daemon.

Comment 5 Lukas Vrabec 2018-05-18 16:46:04 UTC

*** This bug has been marked as a duplicate of bug 1574418 ***

Comment 8 Milos Malik 2018-11-06 08:21:24 UTC
The 3.13.1-229.el7_6.5 version is newer than 3.13.1-229.el7 version, which means that the latest version of selinux-policy is installed on your machines.


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