Bug 250907

Summary: SELinux is preventing /usr/sbin/in.ntalkd (ktalkd_t) "search" to / (devpts_t).
Product: [Fedora] Fedora Reporter: Jacob Masaki <jtmasaki>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: gmaxwell, vcrhonek
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Current Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-11-18 10:29:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output from selinux troubleshooter. none

Description Jacob Masaki 2007-08-04 23:57:44 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.5) Gecko/20070718 Fedora/2.0.0.5-1.fc7 Firefox/2.0.0.5

Description of problem:
When I run talk on my local machine (to another local terminal) it replies with "Target machine is too confused to talk to us" and SELinux troubleschooter pops up with a denial.

With SELinux set to permissive everything works fine.  

Version-Release number of selected component (if applicable):
talk-server-0.17-29.2.2, selinux-policy-2.6.4-30.fc7, selinux-policy-targeted-2.6.4-30.fc7

How reproducible:
Always


Steps to Reproduce:
1. Install talk-server
2. Activate and start xinetd through system-config-services
3. Activate talk and ntalk under the "on demand services" tab
4. Run "talk" from one local terminal to another ("who am i" gives the info you need to choose proper arguments.

Actual Results:
Talk displays "Target machine is too confused to talk to us" then tries to connect until it is killed.  

Expected Results:
Talk should have connected the two terminals so they can send messages back and forth.  

Additional info:

Comment 1 Jacob Masaki 2007-08-04 23:59:07 UTC
Created attachment 160704 [details]
Output from selinux troubleshooter.

Comment 2 Daniel Walsh 2007-09-04 13:23:49 UTC
Fixed in selinux-policy-2.6.4-41

Comment 3 Daniel Walsh 2008-01-30 19:19:42 UTC
Bulk closing all bugs in Fedora updates in the modified state.  If you bug is
not fixed, please reopen.

Comment 4 Gregory Maxwell 2009-02-21 04:26:14 UTC
Problem seems to be back, ntalk is incorrectly telling me that the other party is refusing messages. 

[root@cherenkov gmaxwell]#  sealert -l b99d40e7-3aba-4703-9dea-b2df3d8b905a

Summary:

SELinux prevented in.ntalkd from using the terminal 4.

Detailed Description:

SELinux prevented in.ntalkd from using the terminal 4. In most cases daemons do
not need to interact with the terminal, usually these avc messages can be
ignored. All of the confined daemons should have dontaudit rules around using
the terminal. Please file a bug report
(http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this selinux-policy.
If you would like to allow all daemons to interact with the terminal, you can
turn on the allow_daemons_use_tty boolean.

Allowing Access:

Changing the "allow_daemons_use_tty" boolean to true will allow this access:
"setsebool -P allow_daemons_use_tty=1."

Fix Command:

setsebool -P allow_daemons_use_tty=1

Additional Information:

Source Context                unconfined_u:system_r:ktalkd_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:unconfined_devpts_t:s0
Target Objects                4 [ chr_file ]
Source                        in.ntalkd
Source Path                   /usr/sbin/in.ntalkd
Port                          <Unknown>
Host                          cherenkov
Source RPM Packages           talk-server-0.17-30.2.4
Target RPM Packages           
Policy RPM                    selinux-policy-3.5.13-45.fc10
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   allow_daemons_use_tty
Host Name                     cherenkov
Platform                      Linux cherenkov 2.6.27.12-170.2.5.fc10.x86_64 #1
                              SMP Wed Jan 21 01:33:24 EST 2009 x86_64 x86_64
Alert Count                   5
First Seen                    Fri Feb 20 23:16:01 2009
Last Seen                     Fri Feb 20 23:22:44 2009
Local ID                      b99d40e7-3aba-4703-9dea-b2df3d8b905a
Line Numbers                  

Raw Audit Messages            

node=cherenkov type=AVC msg=audit(1235190164.503:7176): avc:  denied  { write } for  pid=17203 comm="in.ntalkd" name="4" dev=devpts ino=6 scontext=unconfined_u:system_r:ktalkd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:unconfined_devpts_t:s0 tclass=chr_file

node=cherenkov type=SYSCALL msg=audit(1235190164.503:7176): arch=c000003e syscall=2 success=no exit=-13 a0=7fffada46470 a1=101 a2=b a3=7fffada45c10 items=0 ppid=17198 pid=17203 auid=500 uid=99 gid=5 euid=99 suid=99 fsuid=99 egid=5 sgid=5 fsgid=5 tty=(none) ses=1073 comm="in.ntalkd" exe="/usr/sbin/in.ntalkd" subj=unconfined_u:system_r:ktalkd_t:s0-s0:c0.c1023 key=(null)



[root@cherenkov gmaxwell]# getsebool allow_daemons_use_tty
allow_daemons_use_tty --> on
[root@cherenkov gmaxwell]# cat /etc/redhat-release 
Fedora release 10 (Cambridge)
[root@cherenkov gmaxwell]# uname -a
Linux cherenkov 2.6.27.12-170.2.5.fc10.x86_64 #1 SMP Wed Jan 21 01:33:24 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@cherenkov gmaxwell]# rpm -q selinux-policy
selinux-policy-3.5.13-45.fc10.noarch

Comment 5 Daniel Walsh 2009-02-23 15:05:58 UTC
Miroslav, 

add

term_use_all_terms(ktalk_t)

ktalk needs to write to terminals.

Comment 6 Miroslav Grepl 2009-02-27 09:51:06 UTC
Fixed in selinux-policy-3.5.13-47.fc10

Comment 7 Bug Zapper 2009-11-18 10:07:25 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  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 WONTFIX if it remains open with a Fedora 
'version' of '10'.

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 prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping