Bug 432353

Summary: SELinux prevented dbus-daemon from using the terminal /dev/tty1.
Product: [Fedora] Fedora Reporter: Matěj Cepl <mcepl>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: dwalsh, mcepl
Target Milestone: ---Keywords: Reopened, SELinux
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-05 22:19:09 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:

Description Matěj Cepl 2008-02-11 15:16:02 UTC
Description of problem:

Souhrn:

SELinux prevented dbus-daemon from using the terminal /dev/tty1.

Podrobný popis:

SELinux prevented dbus-daemon from using the terminal /dev/tty1. 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.

Povolení přístupu:

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

Tento přístup povolí následující příkaz:

setsebool -P allow_daemons_use_tty=1

Další informace:

Kontext zdroje                unconfined_u:unconfined_r:unconfined_dbusd_t
                              :SystemLow-SystemHigh
Kontext cíle                 unconfined_u:object_r:unconfined_tty_device_t
Objekty cíle                 /dev/tty1 [ chr_file ]
Zdroj                         dbus-daemon
Cesta zdroje                  /bin/dbus-daemon
Port                          <Neznámé>
Počítač                    hubmaier.ceplovi.cz
RPM balíčky zdroje          dbus-1.1.4-4.fc9
RPM balíčky cíle           
RPM politiky                  selinux-policy-3.2.7-1.fc9
Selinux povolen               True
Typ politiky                  targeted
MLS povoleno                  True
Vynucovací režim            Enforcing
Název zásuvného modulu     allow_daemons_use_tty
Název počítače            hubmaier.ceplovi.cz
Platforma                     Linux hubmaier.ceplovi.cz 2.6.24.1-26.fc9 #1 SMP
                              Fri Feb 8 19:14:51 EST 2008 x86_64 x86_64
Počet uporoznění           3
Poprvé viděno               Po 11. únor 2008, 11:04:08 CET
Naposledy viděno             Po 11. únor 2008, 11:07:49 CET
Místní ID                   31245b5c-baa2-48ea-8338-cd92dcfdbb9d
Čísla řádků              

Původní zprávy auditu      

host=hubmaier.ceplovi.cz type=AVC msg=audit(1202724469.24:92): avc:  denied  {
read write } for  pid=4649 comm="dbus-daemon" path="/dev/tty1" dev=tmpfs
ino=1918 scontext=unconfined_u:unconfined_r:unconfined_dbusd_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:unconfined_tty_device_t:s0 tclass=chr_file

host=hubmaier.ceplovi.cz type=AVC msg=audit(1202724469.24:92): avc:  denied  {
read write } for  pid=4649 comm="dbus-daemon" path="/dev/tty1" dev=tmpfs
ino=1918 scontext=unconfined_u:unconfined_r:unconfined_dbusd_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:unconfined_tty_device_t:s0 tclass=chr_file

host=hubmaier.ceplovi.cz type=SYSCALL msg=audit(1202724469.24:92): arch=c000003e
syscall=59 success=yes exit=0 a0=7fff1692a8fb a1=7fff1692a9b0 a2=67bb40
a3=8101010101010100 items=0 ppid=4642 pid=4649 auid=500 uid=500 gid=500 euid=500
suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) comm="dbus-daemon"
exe="/bin/dbus-daemon"
subj=unconfined_u:unconfined_r:unconfined_dbusd_t:s0-s0:c0.c1023 key=(null)

Version-Release number of selected component (if applicable):
dbus-1.1.4-4.fc9.x86_64
selinux-policy-targeted-3.2.7-1.fc9.noarch

Comment 1 Daniel Walsh 2008-02-11 22:08:34 UTC
Fixed in selinux-policy-3.2.7-3.fc9

Comment 2 Stepan Kasal 2008-02-13 16:30:27 UTC
The fix works for the original reporter with selinux-policy-3.2.7-3.fc9.  (He
sits at the next desk.)

However, I have just upgraded to selinux-policy-3.2.7-4.fc9 (and rebooted), and
observe an almost identical problem.  The difference is that I use runlevel 3
and startx from tty6 (or tty11 or whatever).
Other differences: i386, selinux-policy-3.2.7-4.fc9

The messages in audit.log are:
type=AVC msg=audit(1202910517.486:49): avc:  denied  { read write } for 
pid=4768 comm="dbus-daemon" path="/dev/tty6" dev=tmpfs ino=2310
scontext=unconfined_u:unconfined_r:unconfined_dbusd_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:unconfined_tty_device_t:s0 tclass=chr_file
type=SYSCALL msg=audit(1202910517.486:49): arch=40000003 syscall=11 success=yes
exit=0 a0=804c907 a1=bff4414c a2=bff45574 a3=7 items=0 ppid=4767 pid=4768
auid=10464 uid=10464 gid=10464 euid=10464 suid=10464 fsuid=10464 egid=10464
sgid=10464 fsgid=10464 tty=(none) comm="dbus-daemon" exe="/bin/dbus-daemon"
subj=unconfined_u:unconfined_r:unconfined_dbusd_t:s0-s0:c0.c1023 key=(null)


Comment 3 David Zeuthen 2008-02-13 17:54:48 UTC
(this shouldn't be a surprise: please avoid reporting selinux errors against
anything but selinux packages)

Comment 7 Daniel Walsh 2008-02-26 22:55:40 UTC
Fixed in selinux-policy-3.3.1-4.fc9

Comment 8 Daniel Walsh 2008-03-05 22:19:09 UTC
CLosed as this should be fixed in rawhide.  If this problem persists please
reopen the bugzilla.